[Arm64] Implement BitwiseSelect hardware intrinsic (#472)
authorEgor Chesakov <Egor.Chesakov@microsoft.com>
Thu, 5 Dec 2019 20:10:01 +0000 (12:10 -0800)
committerGitHub <noreply@github.com>
Thu, 5 Dec 2019 20:10:01 +0000 (12:10 -0800)
27 files changed:
src/coreclr/src/jit/codegen.h
src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp
src/coreclr/src/jit/hwintrinsiclistarm64.h
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_r.csproj
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_ro.csproj
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Byte.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Double.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Int16.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Int32.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Int64.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.SByte.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Single.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.UInt16.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.UInt32.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.UInt64.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Byte.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Int16.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Int32.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.SByte.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Single.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.UInt16.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.UInt32.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/Program.AdvSimd.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/GenerateTests.csx
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/Helpers.tt
src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/_TernaryOpTestTemplate.template [new file with mode: 0644]

index 7cd039c..e834147 100644 (file)
@@ -1011,9 +1011,6 @@ protected:
                                          regNumber                 offsReg,
                                          HWIntrinsicSwitchCaseBody emitSwCase);
 #endif // defined(_TARGET_XARCH_)
-#if defined(_TARGET_ARM64_)
-    void genSpecialIntrinsic(GenTreeHWIntrinsic* node);
-#endif // defined(_TARGET_XARCH_)
 #endif // FEATURE_HW_INTRINSICS
 
 #if !defined(_TARGET_64BIT_)
index f793bb7..45199b5 100644 (file)
@@ -234,6 +234,26 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
 
         switch (intrin.id)
         {
+            case NI_AdvSimd_BitwiseSelect:
+                if (targetReg == op1Reg)
+                {
+                    GetEmitter()->emitIns_R_R_R(INS_bsl, emitSize, targetReg, op2Reg, op3Reg, opt);
+                }
+                else if (targetReg == op2Reg)
+                {
+                    GetEmitter()->emitIns_R_R_R(INS_bif, emitSize, targetReg, op3Reg, op1Reg, opt);
+                }
+                else if (targetReg == op3Reg)
+                {
+                    GetEmitter()->emitIns_R_R_R(INS_bit, emitSize, targetReg, op2Reg, op1Reg, opt);
+                }
+                else
+                {
+                    GetEmitter()->emitIns_R_R(INS_mov, emitSize, targetReg, op1Reg);
+                    GetEmitter()->emitIns_R_R_R(INS_bsl, emitSize, targetReg, op2Reg, op3Reg, opt);
+                }
+                break;
+
             case NI_Aes_Decrypt:
             case NI_Aes_Encrypt:
                 if (targetReg != op1Reg)
index 0ea3ff3..1734173 100644 (file)
@@ -52,6 +52,7 @@ HARDWARE_INTRINSIC(AdvSimd,         Abs,                                       -
 HARDWARE_INTRINSIC(AdvSimd,         AbsScalar,                                 -1,               8,           1,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_fabs,           INS_fabs},              HW_Category_SIMDScalar,             HW_Flag_NoContainment)
 HARDWARE_INTRINSIC(AdvSimd,         Add,                                       -1,              -1,           2,     {INS_add,               INS_add,            INS_add,            INS_add,            INS_add,            INS_add,            INS_add,            INS_add,            INS_fadd,           INS_invalid},           HW_Category_SimpleSIMD,             HW_Flag_NoContainment|HW_Flag_Commutative|HW_Flag_UnfixedSIMDSize)
 HARDWARE_INTRINSIC(AdvSimd,         AddScalar,                                 -1,               8,           2,     {INS_add,               INS_add,            INS_add,            INS_add,            INS_add,            INS_add,            INS_add,            INS_add,            INS_fadd,           INS_fadd},              HW_Category_SIMDScalar,             HW_Flag_NoContainment|HW_Flag_Commutative)
+HARDWARE_INTRINSIC(AdvSimd,         BitwiseSelect,                             -1,              -1,           3,     {INS_bsl,               INS_bsl,            INS_bsl,            INS_bsl,            INS_bsl,            INS_bsl,            INS_bsl,            INS_bsl,            INS_bsl,            INS_bsl},               HW_Category_SimpleSIMD,             HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize|HW_Flag_SpecialCodeGen)
 HARDWARE_INTRINSIC(AdvSimd,         LeadingSignCount,                          -1,              -1,           1,     {INS_cls,               INS_invalid,        INS_cls,            INS_invalid,        INS_cls,            INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid},           HW_Category_SimpleSIMD,             HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize)
 HARDWARE_INTRINSIC(AdvSimd,         LeadingZeroCount,                          -1,              -1,           1,     {INS_clz,               INS_clz,            INS_clz,            INS_clz,            INS_clz,            INS_clz,            INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid},           HW_Category_SimpleSIMD,             HW_Flag_NoContainment|HW_Flag_UnfixedSIMDSize)
 HARDWARE_INTRINSIC(AdvSimd,         LoadVector64,                              -1,               8,           1,     {INS_ld1,               INS_ld1,            INS_ld1,            INS_ld1,            INS_ld1,            INS_ld1,            INS_ld1,            INS_ld1,            INS_ld1,            INS_ld1},               HW_Category_MemoryLoad,             HW_Flag_NoRMWSemantics)
index 57bc30b..152e735 100644 (file)
     <Compile Include="Add.Vector128.UInt32.cs" />
     <Compile Include="Add.Vector128.UInt64.cs" />
     <Compile Include="AddScalar.Vector64.Single.cs" />
+    <Compile Include="BitwiseSelect.Vector64.Byte.cs" />
+    <Compile Include="BitwiseSelect.Vector64.Int16.cs" />
+    <Compile Include="BitwiseSelect.Vector64.Int32.cs" />
+    <Compile Include="BitwiseSelect.Vector64.SByte.cs" />
+    <Compile Include="BitwiseSelect.Vector64.Single.cs" />
+    <Compile Include="BitwiseSelect.Vector64.UInt16.cs" />
+    <Compile Include="BitwiseSelect.Vector64.UInt32.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Byte.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Double.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Int16.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Int32.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Int64.cs" />
+    <Compile Include="BitwiseSelect.Vector128.SByte.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Single.cs" />
+    <Compile Include="BitwiseSelect.Vector128.UInt16.cs" />
+    <Compile Include="BitwiseSelect.Vector128.UInt32.cs" />
+    <Compile Include="BitwiseSelect.Vector128.UInt64.cs" />
     <Compile Include="LeadingSignCount.Vector64.Int16.cs" />
     <Compile Include="LeadingSignCount.Vector64.Int32.cs" />
     <Compile Include="LeadingSignCount.Vector64.SByte.cs" />
index 6e4370f..347e655 100644 (file)
     <Compile Include="Add.Vector128.UInt32.cs" />
     <Compile Include="Add.Vector128.UInt64.cs" />
     <Compile Include="AddScalar.Vector64.Single.cs" />
+    <Compile Include="BitwiseSelect.Vector64.Byte.cs" />
+    <Compile Include="BitwiseSelect.Vector64.Int16.cs" />
+    <Compile Include="BitwiseSelect.Vector64.Int32.cs" />
+    <Compile Include="BitwiseSelect.Vector64.SByte.cs" />
+    <Compile Include="BitwiseSelect.Vector64.Single.cs" />
+    <Compile Include="BitwiseSelect.Vector64.UInt16.cs" />
+    <Compile Include="BitwiseSelect.Vector64.UInt32.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Byte.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Double.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Int16.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Int32.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Int64.cs" />
+    <Compile Include="BitwiseSelect.Vector128.SByte.cs" />
+    <Compile Include="BitwiseSelect.Vector128.Single.cs" />
+    <Compile Include="BitwiseSelect.Vector128.UInt16.cs" />
+    <Compile Include="BitwiseSelect.Vector128.UInt32.cs" />
+    <Compile Include="BitwiseSelect.Vector128.UInt64.cs" />
     <Compile Include="LeadingSignCount.Vector64.Int16.cs" />
     <Compile Include="LeadingSignCount.Vector64.Int32.cs" />
     <Compile Include="LeadingSignCount.Vector64.SByte.cs" />
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Byte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Byte.cs
new file mode 100644 (file)
index 0000000..7f7a1cc
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_Byte()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Byte();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_Byte
+    {
+        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<Byte>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Byte>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Byte>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Byte>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Byte, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Byte, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Byte, byte>(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 Vector128<Byte> _fld1;
+            public Vector128<Byte> _fld2;
+            public Vector128<Byte> _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<Vector128<Byte>, byte>(ref testStruct._fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref testStruct._fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref testStruct._fld3), ref Unsafe.As<Byte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_Byte testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_Byte testClass)
+            {
+                fixed (Vector128<Byte>* pFld1 = &_fld1)
+                fixed (Vector128<Byte>* pFld2 = &_fld2)
+                fixed (Vector128<Byte>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((Byte*)(pFld1)),
+                        AdvSimd.LoadVector128((Byte*)(pFld2)),
+                        AdvSimd.LoadVector128((Byte*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Byte>>() / sizeof(Byte);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Byte>>() / sizeof(Byte);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Byte>>() / sizeof(Byte);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Byte>>() / 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 Vector128<Byte> _clsVar1;
+        private static Vector128<Byte> _clsVar2;
+        private static Vector128<Byte> _clsVar3;
+
+        private Vector128<Byte> _fld1;
+        private Vector128<Byte> _fld2;
+        private Vector128<Byte> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_Byte()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _clsVar1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _clsVar2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _clsVar3), ref Unsafe.As<Byte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_Byte()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Byte>, byte>(ref _fld3), ref Unsafe.As<Byte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<Byte>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Byte>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<Byte>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((Byte*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Byte>), typeof(Vector128<Byte>), typeof(Vector128<Byte>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Byte>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Byte>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<Byte>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Byte>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Byte>), typeof(Vector128<Byte>), typeof(Vector128<Byte>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Byte>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<Byte>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<Byte>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<Byte>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Byte*)(pClsVar1)),
+                    AdvSimd.LoadVector128((Byte*)(pClsVar2)),
+                    AdvSimd.LoadVector128((Byte*)(pClsVar3))
+                );
+
+                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<Vector128<Byte>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<Byte>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<Byte>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((Byte*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_Byte();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Byte();
+
+            fixed (Vector128<Byte>* pFld1 = &test._fld1)
+            fixed (Vector128<Byte>* pFld2 = &test._fld2)
+            fixed (Vector128<Byte>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Byte*)(pFld1)),
+                    AdvSimd.LoadVector128((Byte*)(pFld2)),
+                    AdvSimd.LoadVector128((Byte*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<Byte>* pFld1 = &_fld1)
+            fixed (Vector128<Byte>* pFld2 = &_fld2)
+            fixed (Vector128<Byte>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Byte*)(pFld1)),
+                    AdvSimd.LoadVector128((Byte*)(pFld2)),
+                    AdvSimd.LoadVector128((Byte*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Byte*)(&test._fld1)),
+                AdvSimd.LoadVector128((Byte*)(&test._fld2)),
+                AdvSimd.LoadVector128((Byte*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<Byte> op1, Vector128<Byte> op2, Vector128<Byte> 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<Byte, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+
+            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<Byte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Byte>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] thirdOp, Byte[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Byte>(Vector128<Byte>, Vector128<Byte>, Vector128<Byte>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Double.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Double.cs
new file mode 100644 (file)
index 0000000..3a9460e
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_Double()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Double();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_Double
+    {
+        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<Double>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Double>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Double>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Double>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Double, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Double, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Double, byte>(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 Vector128<Double> _fld1;
+            public Vector128<Double> _fld2;
+            public Vector128<Double> _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<Vector128<Double>, byte>(ref testStruct._fld1), ref Unsafe.As<Double, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Double>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Double>, byte>(ref testStruct._fld2), ref Unsafe.As<Double, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Double>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Double>, byte>(ref testStruct._fld3), ref Unsafe.As<Double, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Double>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_Double testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_Double testClass)
+            {
+                fixed (Vector128<Double>* pFld1 = &_fld1)
+                fixed (Vector128<Double>* pFld2 = &_fld2)
+                fixed (Vector128<Double>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((Double*)(pFld1)),
+                        AdvSimd.LoadVector128((Double*)(pFld2)),
+                        AdvSimd.LoadVector128((Double*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Double>>() / sizeof(Double);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Double>>() / sizeof(Double);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Double>>() / sizeof(Double);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Double>>() / 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 Vector128<Double> _clsVar1;
+        private static Vector128<Double> _clsVar2;
+        private static Vector128<Double> _clsVar3;
+
+        private Vector128<Double> _fld1;
+        private Vector128<Double> _fld2;
+        private Vector128<Double> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_Double()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Double>, byte>(ref _clsVar1), ref Unsafe.As<Double, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Double>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Double>, byte>(ref _clsVar2), ref Unsafe.As<Double, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Double>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Double>, byte>(ref _clsVar3), ref Unsafe.As<Double, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Double>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_Double()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetDouble(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Double>, byte>(ref _fld1), ref Unsafe.As<Double, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Double>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetDouble(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Double>, byte>(ref _fld2), ref Unsafe.As<Double, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Double>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetDouble(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Double>, byte>(ref _fld3), ref Unsafe.As<Double, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Double>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<Double>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Double>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<Double>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((Double*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Double>), typeof(Vector128<Double>), typeof(Vector128<Double>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Double>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Double>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<Double>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Double>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Double>), typeof(Vector128<Double>), typeof(Vector128<Double>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((Double*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Double>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<Double>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<Double>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<Double>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Double*)(pClsVar1)),
+                    AdvSimd.LoadVector128((Double*)(pClsVar2)),
+                    AdvSimd.LoadVector128((Double*)(pClsVar3))
+                );
+
+                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<Vector128<Double>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<Double>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<Double>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((Double*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_Double();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Double();
+
+            fixed (Vector128<Double>* pFld1 = &test._fld1)
+            fixed (Vector128<Double>* pFld2 = &test._fld2)
+            fixed (Vector128<Double>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Double*)(pFld1)),
+                    AdvSimd.LoadVector128((Double*)(pFld2)),
+                    AdvSimd.LoadVector128((Double*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<Double>* pFld1 = &_fld1)
+            fixed (Vector128<Double>* pFld2 = &_fld2)
+            fixed (Vector128<Double>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Double*)(pFld1)),
+                    AdvSimd.LoadVector128((Double*)(pFld2)),
+                    AdvSimd.LoadVector128((Double*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Double*)(&test._fld1)),
+                AdvSimd.LoadVector128((Double*)(&test._fld2)),
+                AdvSimd.LoadVector128((Double*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<Double> op1, Vector128<Double> op2, Vector128<Double> 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<Double, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Double, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Double>>());
+
+            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<Double, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Double>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Double, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Double>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Double, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Double>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Double, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Double>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Double[] firstOp, Double[] secondOp, Double[] thirdOp, Double[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Double>(Vector128<Double>, Vector128<Double>, Vector128<Double>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Int16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Int16.cs
new file mode 100644 (file)
index 0000000..e7a0531
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_Int16()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Int16();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_Int16
+    {
+        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<Int16>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int16>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int16>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int16>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Int16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int16, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int16, byte>(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 Vector128<Int16> _fld1;
+            public Vector128<Int16> _fld2;
+            public Vector128<Int16> _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<Vector128<Int16>, byte>(ref testStruct._fld1), ref Unsafe.As<Int16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int16>, byte>(ref testStruct._fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int16>, byte>(ref testStruct._fld3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_Int16 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_Int16 testClass)
+            {
+                fixed (Vector128<Int16>* pFld1 = &_fld1)
+                fixed (Vector128<Int16>* pFld2 = &_fld2)
+                fixed (Vector128<Int16>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((Int16*)(pFld1)),
+                        AdvSimd.LoadVector128((Int16*)(pFld2)),
+                        AdvSimd.LoadVector128((Int16*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int16>>() / sizeof(Int16);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Int16>>() / sizeof(Int16);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Int16>>() / sizeof(Int16);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int16>>() / 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 Vector128<Int16> _clsVar1;
+        private static Vector128<Int16> _clsVar2;
+        private static Vector128<Int16> _clsVar3;
+
+        private Vector128<Int16> _fld1;
+        private Vector128<Int16> _fld2;
+        private Vector128<Int16> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_Int16()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int16>, byte>(ref _clsVar1), ref Unsafe.As<Int16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int16>, byte>(ref _clsVar2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int16>, byte>(ref _clsVar3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_Int16()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int16>, byte>(ref _fld1), ref Unsafe.As<Int16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int16>, byte>(ref _fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int16>, byte>(ref _fld3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<Int16>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Int16>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<Int16>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((Int16*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Int16>), typeof(Vector128<Int16>), typeof(Vector128<Int16>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Int16>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Int16>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<Int16>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int16>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Int16>), typeof(Vector128<Int16>), typeof(Vector128<Int16>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int16>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<Int16>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<Int16>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<Int16>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Int16*)(pClsVar1)),
+                    AdvSimd.LoadVector128((Int16*)(pClsVar2)),
+                    AdvSimd.LoadVector128((Int16*)(pClsVar3))
+                );
+
+                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<Vector128<Int16>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<Int16>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<Int16>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_Int16();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Int16();
+
+            fixed (Vector128<Int16>* pFld1 = &test._fld1)
+            fixed (Vector128<Int16>* pFld2 = &test._fld2)
+            fixed (Vector128<Int16>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Int16*)(pFld1)),
+                    AdvSimd.LoadVector128((Int16*)(pFld2)),
+                    AdvSimd.LoadVector128((Int16*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<Int16>* pFld1 = &_fld1)
+            fixed (Vector128<Int16>* pFld2 = &_fld2)
+            fixed (Vector128<Int16>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Int16*)(pFld1)),
+                    AdvSimd.LoadVector128((Int16*)(pFld2)),
+                    AdvSimd.LoadVector128((Int16*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Int16*)(&test._fld1)),
+                AdvSimd.LoadVector128((Int16*)(&test._fld2)),
+                AdvSimd.LoadVector128((Int16*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<Int16> op1, Vector128<Int16> op2, Vector128<Int16> 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<Int16, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+
+            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<Int16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int16>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Int16>(Vector128<Int16>, Vector128<Int16>, Vector128<Int16>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Int32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Int32.cs
new file mode 100644 (file)
index 0000000..603c1bf
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_Int32()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Int32();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_Int32
+    {
+        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<Int32>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int32>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int32, byte>(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 Vector128<Int32> _fld1;
+            public Vector128<Int32> _fld2;
+            public Vector128<Int32> _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<Vector128<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_Int32 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_Int32 testClass)
+            {
+                fixed (Vector128<Int32>* pFld1 = &_fld1)
+                fixed (Vector128<Int32>* pFld2 = &_fld2)
+                fixed (Vector128<Int32>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((Int32*)(pFld1)),
+                        AdvSimd.LoadVector128((Int32*)(pFld2)),
+                        AdvSimd.LoadVector128((Int32*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int32>>() / 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 Vector128<Int32> _clsVar1;
+        private static Vector128<Int32> _clsVar2;
+        private static Vector128<Int32> _clsVar3;
+
+        private Vector128<Int32> _fld1;
+        private Vector128<Int32> _fld2;
+        private Vector128<Int32> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_Int32()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_Int32()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((Int32*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>), typeof(Vector128<Int32>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>), typeof(Vector128<Int32>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<Int32>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<Int32>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<Int32>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Int32*)(pClsVar1)),
+                    AdvSimd.LoadVector128((Int32*)(pClsVar2)),
+                    AdvSimd.LoadVector128((Int32*)(pClsVar3))
+                );
+
+                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<Vector128<Int32>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_Int32();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Int32();
+
+            fixed (Vector128<Int32>* pFld1 = &test._fld1)
+            fixed (Vector128<Int32>* pFld2 = &test._fld2)
+            fixed (Vector128<Int32>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Int32*)(pFld1)),
+                    AdvSimd.LoadVector128((Int32*)(pFld2)),
+                    AdvSimd.LoadVector128((Int32*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<Int32>* pFld1 = &_fld1)
+            fixed (Vector128<Int32>* pFld2 = &_fld2)
+            fixed (Vector128<Int32>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Int32*)(pFld1)),
+                    AdvSimd.LoadVector128((Int32*)(pFld2)),
+                    AdvSimd.LoadVector128((Int32*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Int32*)(&test._fld1)),
+                AdvSimd.LoadVector128((Int32*)(&test._fld2)),
+                AdvSimd.LoadVector128((Int32*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<Int32> op1, Vector128<Int32> op2, Vector128<Int32> 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<Int32, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+
+            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<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Int32>(Vector128<Int32>, Vector128<Int32>, Vector128<Int32>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Int64.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Int64.cs
new file mode 100644 (file)
index 0000000..e40c1e3
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_Int64()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Int64();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_Int64
+    {
+        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<Int64>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int64>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int64>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int64>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Int64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int64, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int64, byte>(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 Vector128<Int64> _fld1;
+            public Vector128<Int64> _fld2;
+            public Vector128<Int64> _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<Vector128<Int64>, byte>(ref testStruct._fld1), ref Unsafe.As<Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref testStruct._fld2), ref Unsafe.As<Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt64(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref testStruct._fld3), ref Unsafe.As<Int64, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_Int64 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_Int64 testClass)
+            {
+                fixed (Vector128<Int64>* pFld1 = &_fld1)
+                fixed (Vector128<Int64>* pFld2 = &_fld2)
+                fixed (Vector128<Int64>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((Int64*)(pFld1)),
+                        AdvSimd.LoadVector128((Int64*)(pFld2)),
+                        AdvSimd.LoadVector128((Int64*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int64>>() / sizeof(Int64);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Int64>>() / sizeof(Int64);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Int64>>() / sizeof(Int64);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int64>>() / 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 Vector128<Int64> _clsVar1;
+        private static Vector128<Int64> _clsVar2;
+        private static Vector128<Int64> _clsVar3;
+
+        private Vector128<Int64> _fld1;
+        private Vector128<Int64> _fld2;
+        private Vector128<Int64> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_Int64()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _clsVar1), ref Unsafe.As<Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _clsVar2), ref Unsafe.As<Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _clsVar3), ref Unsafe.As<Int64, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_Int64()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _fld1), ref Unsafe.As<Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _fld2), ref Unsafe.As<Int64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int64>, byte>(ref _fld3), ref Unsafe.As<Int64, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<Int64>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Int64>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<Int64>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Int64*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((Int64*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Int64>), typeof(Vector128<Int64>), typeof(Vector128<Int64>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Int64>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Int64>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<Int64>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Int64>), typeof(Vector128<Int64>), typeof(Vector128<Int64>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((Int64*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((Int64*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int64>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<Int64>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<Int64>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<Int64>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Int64*)(pClsVar1)),
+                    AdvSimd.LoadVector128((Int64*)(pClsVar2)),
+                    AdvSimd.LoadVector128((Int64*)(pClsVar3))
+                );
+
+                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<Vector128<Int64>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<Int64>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<Int64>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((Int64*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((Int64*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((Int64*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_Int64();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Int64();
+
+            fixed (Vector128<Int64>* pFld1 = &test._fld1)
+            fixed (Vector128<Int64>* pFld2 = &test._fld2)
+            fixed (Vector128<Int64>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Int64*)(pFld1)),
+                    AdvSimd.LoadVector128((Int64*)(pFld2)),
+                    AdvSimd.LoadVector128((Int64*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<Int64>* pFld1 = &_fld1)
+            fixed (Vector128<Int64>* pFld2 = &_fld2)
+            fixed (Vector128<Int64>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Int64*)(pFld1)),
+                    AdvSimd.LoadVector128((Int64*)(pFld2)),
+                    AdvSimd.LoadVector128((Int64*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Int64*)(&test._fld1)),
+                AdvSimd.LoadVector128((Int64*)(&test._fld2)),
+                AdvSimd.LoadVector128((Int64*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<Int64> op1, Vector128<Int64> op2, Vector128<Int64> 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<Int64, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+
+            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<Int64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int64>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Int64[] firstOp, Int64[] secondOp, Int64[] thirdOp, Int64[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Int64>(Vector128<Int64>, Vector128<Int64>, Vector128<Int64>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.SByte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.SByte.cs
new file mode 100644 (file)
index 0000000..d9c9307
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_SByte()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_SByte();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_SByte
+    {
+        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<SByte>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<SByte>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<SByte>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<SByte>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<SByte, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<SByte, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<SByte, byte>(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 Vector128<SByte> _fld1;
+            public Vector128<SByte> _fld2;
+            public Vector128<SByte> _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<Vector128<SByte>, byte>(ref testStruct._fld1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref testStruct._fld2), ref Unsafe.As<SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref testStruct._fld3), ref Unsafe.As<SByte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_SByte testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_SByte testClass)
+            {
+                fixed (Vector128<SByte>* pFld1 = &_fld1)
+                fixed (Vector128<SByte>* pFld2 = &_fld2)
+                fixed (Vector128<SByte>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((SByte*)(pFld1)),
+                        AdvSimd.LoadVector128((SByte*)(pFld2)),
+                        AdvSimd.LoadVector128((SByte*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<SByte>>() / sizeof(SByte);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<SByte>>() / sizeof(SByte);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<SByte>>() / sizeof(SByte);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<SByte>>() / 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 Vector128<SByte> _clsVar1;
+        private static Vector128<SByte> _clsVar2;
+        private static Vector128<SByte> _clsVar3;
+
+        private Vector128<SByte> _fld1;
+        private Vector128<SByte> _fld2;
+        private Vector128<SByte> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_SByte()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _clsVar1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _clsVar2), ref Unsafe.As<SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _clsVar3), ref Unsafe.As<SByte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_SByte()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _fld1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _fld2), ref Unsafe.As<SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _fld3), ref Unsafe.As<SByte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<SByte>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<SByte>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<SByte>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((SByte*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<SByte>), typeof(Vector128<SByte>), typeof(Vector128<SByte>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<SByte>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<SByte>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<SByte>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<SByte>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<SByte>), typeof(Vector128<SByte>), typeof(Vector128<SByte>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<SByte>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<SByte>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<SByte>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<SByte>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((SByte*)(pClsVar1)),
+                    AdvSimd.LoadVector128((SByte*)(pClsVar2)),
+                    AdvSimd.LoadVector128((SByte*)(pClsVar3))
+                );
+
+                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<Vector128<SByte>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<SByte>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<SByte>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((SByte*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_SByte();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_SByte();
+
+            fixed (Vector128<SByte>* pFld1 = &test._fld1)
+            fixed (Vector128<SByte>* pFld2 = &test._fld2)
+            fixed (Vector128<SByte>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((SByte*)(pFld1)),
+                    AdvSimd.LoadVector128((SByte*)(pFld2)),
+                    AdvSimd.LoadVector128((SByte*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<SByte>* pFld1 = &_fld1)
+            fixed (Vector128<SByte>* pFld2 = &_fld2)
+            fixed (Vector128<SByte>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((SByte*)(pFld1)),
+                    AdvSimd.LoadVector128((SByte*)(pFld2)),
+                    AdvSimd.LoadVector128((SByte*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((SByte*)(&test._fld1)),
+                AdvSimd.LoadVector128((SByte*)(&test._fld2)),
+                AdvSimd.LoadVector128((SByte*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<SByte> op1, Vector128<SByte> op2, Vector128<SByte> 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<SByte, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+
+            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<SByte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<SByte>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] thirdOp, SByte[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<SByte>(Vector128<SByte>, Vector128<SByte>, Vector128<SByte>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.Single.cs
new file mode 100644 (file)
index 0000000..8df9bff
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_Single()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Single();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_Single
+    {
+        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<Single>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Single>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Single>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Single, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Single, byte>(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 Vector128<Single> _fld1;
+            public Vector128<Single> _fld2;
+            public Vector128<Single> _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<Vector128<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref testStruct._fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref testStruct._fld3), ref Unsafe.As<Single, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_Single testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_Single testClass)
+            {
+                fixed (Vector128<Single>* pFld1 = &_fld1)
+                fixed (Vector128<Single>* pFld2 = &_fld2)
+                fixed (Vector128<Single>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((Single*)(pFld1)),
+                        AdvSimd.LoadVector128((Single*)(pFld2)),
+                        AdvSimd.LoadVector128((Single*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / 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 Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+        private static Vector128<Single> _clsVar3;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+        private Vector128<Single> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_Single()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar3), ref Unsafe.As<Single, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_Single()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld3), ref Unsafe.As<Single, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((Single*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(Vector128<Single>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(Vector128<Single>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((Single*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<Single>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<Single>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<Single>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Single*)(pClsVar1)),
+                    AdvSimd.LoadVector128((Single*)(pClsVar2)),
+                    AdvSimd.LoadVector128((Single*)(pClsVar3))
+                );
+
+                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<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<Single>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((Single*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_Single();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_Single();
+
+            fixed (Vector128<Single>* pFld1 = &test._fld1)
+            fixed (Vector128<Single>* pFld2 = &test._fld2)
+            fixed (Vector128<Single>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Single*)(pFld1)),
+                    AdvSimd.LoadVector128((Single*)(pFld2)),
+                    AdvSimd.LoadVector128((Single*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<Single>* pFld1 = &_fld1)
+            fixed (Vector128<Single>* pFld2 = &_fld2)
+            fixed (Vector128<Single>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((Single*)(pFld1)),
+                    AdvSimd.LoadVector128((Single*)(pFld2)),
+                    AdvSimd.LoadVector128((Single*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((Single*)(&test._fld1)),
+                AdvSimd.LoadVector128((Single*)(&test._fld2)),
+                AdvSimd.LoadVector128((Single*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> op1, Vector128<Single> op2, Vector128<Single> 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<Single, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            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<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Single>(Vector128<Single>, Vector128<Single>, Vector128<Single>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.UInt16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.UInt16.cs
new file mode 100644 (file)
index 0000000..240d072
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_UInt16()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt16();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt16
+    {
+        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<UInt16>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt16>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<UInt16>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt16, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<UInt16, byte>(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 Vector128<UInt16> _fld1;
+            public Vector128<UInt16> _fld2;
+            public Vector128<UInt16> _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<Vector128<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref testStruct._fld3), ref Unsafe.As<UInt16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt16 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt16 testClass)
+            {
+                fixed (Vector128<UInt16>* pFld1 = &_fld1)
+                fixed (Vector128<UInt16>* pFld2 = &_fld2)
+                fixed (Vector128<UInt16>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((UInt16*)(pFld1)),
+                        AdvSimd.LoadVector128((UInt16*)(pFld2)),
+                        AdvSimd.LoadVector128((UInt16*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / 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 Vector128<UInt16> _clsVar1;
+        private static Vector128<UInt16> _clsVar2;
+        private static Vector128<UInt16> _clsVar3;
+
+        private Vector128<UInt16> _fld1;
+        private Vector128<UInt16> _fld2;
+        private Vector128<UInt16> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt16()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _clsVar2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _clsVar3), ref Unsafe.As<UInt16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt16()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _fld3), ref Unsafe.As<UInt16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((UInt16*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<UInt16>), typeof(Vector128<UInt16>), typeof(Vector128<UInt16>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt16>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<UInt16>), typeof(Vector128<UInt16>), typeof(Vector128<UInt16>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt16>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<UInt16>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<UInt16>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<UInt16>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((UInt16*)(pClsVar1)),
+                    AdvSimd.LoadVector128((UInt16*)(pClsVar2)),
+                    AdvSimd.LoadVector128((UInt16*)(pClsVar3))
+                );
+
+                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<Vector128<UInt16>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt16();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt16();
+
+            fixed (Vector128<UInt16>* pFld1 = &test._fld1)
+            fixed (Vector128<UInt16>* pFld2 = &test._fld2)
+            fixed (Vector128<UInt16>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((UInt16*)(pFld1)),
+                    AdvSimd.LoadVector128((UInt16*)(pFld2)),
+                    AdvSimd.LoadVector128((UInt16*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<UInt16>* pFld1 = &_fld1)
+            fixed (Vector128<UInt16>* pFld2 = &_fld2)
+            fixed (Vector128<UInt16>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((UInt16*)(pFld1)),
+                    AdvSimd.LoadVector128((UInt16*)(pFld2)),
+                    AdvSimd.LoadVector128((UInt16*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((UInt16*)(&test._fld1)),
+                AdvSimd.LoadVector128((UInt16*)(&test._fld2)),
+                AdvSimd.LoadVector128((UInt16*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<UInt16> op1, Vector128<UInt16> op2, Vector128<UInt16> 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<UInt16, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+
+            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<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] thirdOp, UInt16[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<UInt16>(Vector128<UInt16>, Vector128<UInt16>, Vector128<UInt16>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.UInt32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.UInt32.cs
new file mode 100644 (file)
index 0000000..6b798f7
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_UInt32()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt32();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt32
+    {
+        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<UInt32>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt32>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<UInt32>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt32>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<UInt32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<UInt32, byte>(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 Vector128<UInt32> _fld1;
+            public Vector128<UInt32> _fld2;
+            public Vector128<UInt32> _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<Vector128<UInt32>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref testStruct._fld3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt32 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt32 testClass)
+            {
+                fixed (Vector128<UInt32>* pFld1 = &_fld1)
+                fixed (Vector128<UInt32>* pFld2 = &_fld2)
+                fixed (Vector128<UInt32>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((UInt32*)(pFld1)),
+                        AdvSimd.LoadVector128((UInt32*)(pFld2)),
+                        AdvSimd.LoadVector128((UInt32*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / 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 Vector128<UInt32> _clsVar1;
+        private static Vector128<UInt32> _clsVar2;
+        private static Vector128<UInt32> _clsVar3;
+
+        private Vector128<UInt32> _fld1;
+        private Vector128<UInt32> _fld2;
+        private Vector128<UInt32> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt32()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt32()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((UInt32*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<UInt32>), typeof(Vector128<UInt32>), typeof(Vector128<UInt32>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt32>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<UInt32>), typeof(Vector128<UInt32>), typeof(Vector128<UInt32>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt32>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<UInt32>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<UInt32>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<UInt32>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((UInt32*)(pClsVar1)),
+                    AdvSimd.LoadVector128((UInt32*)(pClsVar2)),
+                    AdvSimd.LoadVector128((UInt32*)(pClsVar3))
+                );
+
+                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<Vector128<UInt32>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((UInt32*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt32();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt32();
+
+            fixed (Vector128<UInt32>* pFld1 = &test._fld1)
+            fixed (Vector128<UInt32>* pFld2 = &test._fld2)
+            fixed (Vector128<UInt32>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((UInt32*)(pFld1)),
+                    AdvSimd.LoadVector128((UInt32*)(pFld2)),
+                    AdvSimd.LoadVector128((UInt32*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<UInt32>* pFld1 = &_fld1)
+            fixed (Vector128<UInt32>* pFld2 = &_fld2)
+            fixed (Vector128<UInt32>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((UInt32*)(pFld1)),
+                    AdvSimd.LoadVector128((UInt32*)(pFld2)),
+                    AdvSimd.LoadVector128((UInt32*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((UInt32*)(&test._fld1)),
+                AdvSimd.LoadVector128((UInt32*)(&test._fld2)),
+                AdvSimd.LoadVector128((UInt32*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<UInt32> op1, Vector128<UInt32> op2, Vector128<UInt32> 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<UInt32, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+
+            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<UInt32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] thirdOp, UInt32[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<UInt32>(Vector128<UInt32>, Vector128<UInt32>, Vector128<UInt32>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.UInt64.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector128.UInt64.cs
new file mode 100644 (file)
index 0000000..deaf7db
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector128_UInt64()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt64();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt64
+    {
+        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<UInt64>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt64>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<UInt64>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt64>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<UInt64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt64, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<UInt64, byte>(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 Vector128<UInt64> _fld1;
+            public Vector128<UInt64> _fld2;
+            public Vector128<UInt64> _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<Vector128<UInt64>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt64(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld3), ref Unsafe.As<UInt64, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt64 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt64 testClass)
+            {
+                fixed (Vector128<UInt64>* pFld1 = &_fld1)
+                fixed (Vector128<UInt64>* pFld2 = &_fld2)
+                fixed (Vector128<UInt64>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector128((UInt64*)(pFld1)),
+                        AdvSimd.LoadVector128((UInt64*)(pFld2)),
+                        AdvSimd.LoadVector128((UInt64*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / 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 Vector128<UInt64> _clsVar1;
+        private static Vector128<UInt64> _clsVar2;
+        private static Vector128<UInt64> _clsVar3;
+
+        private Vector128<UInt64> _fld1;
+        private Vector128<UInt64> _fld2;
+        private Vector128<UInt64> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt64()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar2), ref Unsafe.As<UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar3), ref Unsafe.As<UInt64, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt64()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld2), ref Unsafe.As<UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt64(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld3), ref Unsafe.As<UInt64, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector128((UInt64*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt64>), typeof(Vector128<UInt64>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt64>), typeof(Vector128<UInt64>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector128<UInt64>* pClsVar1 = &_clsVar1)
+            fixed (Vector128<UInt64>* pClsVar2 = &_clsVar2)
+            fixed (Vector128<UInt64>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((UInt64*)(pClsVar1)),
+                    AdvSimd.LoadVector128((UInt64*)(pClsVar2)),
+                    AdvSimd.LoadVector128((UInt64*)(pClsVar3))
+                );
+
+                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<Vector128<UInt64>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt64();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector128_UInt64();
+
+            fixed (Vector128<UInt64>* pFld1 = &test._fld1)
+            fixed (Vector128<UInt64>* pFld2 = &test._fld2)
+            fixed (Vector128<UInt64>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((UInt64*)(pFld1)),
+                    AdvSimd.LoadVector128((UInt64*)(pFld2)),
+                    AdvSimd.LoadVector128((UInt64*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector128<UInt64>* pFld1 = &_fld1)
+            fixed (Vector128<UInt64>* pFld2 = &_fld2)
+            fixed (Vector128<UInt64>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector128((UInt64*)(pFld1)),
+                    AdvSimd.LoadVector128((UInt64*)(pFld2)),
+                    AdvSimd.LoadVector128((UInt64*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector128((UInt64*)(&test._fld1)),
+                AdvSimd.LoadVector128((UInt64*)(&test._fld2)),
+                AdvSimd.LoadVector128((UInt64*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector128<UInt64> op1, Vector128<UInt64> op2, Vector128<UInt64> 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<UInt64, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+
+            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<UInt64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(UInt64[] firstOp, UInt64[] secondOp, UInt64[] thirdOp, UInt64[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<UInt64>(Vector128<UInt64>, Vector128<UInt64>, Vector128<UInt64>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Byte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Byte.cs
new file mode 100644 (file)
index 0000000..8422ca9
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector64_Byte()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_Byte();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector64_Byte
+    {
+        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<Byte>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Byte>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Byte>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Byte>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Byte, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Byte, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Byte, byte>(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 Vector64<Byte> _fld1;
+            public Vector64<Byte> _fld2;
+            public Vector64<Byte> _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<Vector64<Byte>, byte>(ref testStruct._fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref testStruct._fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref testStruct._fld3), ref Unsafe.As<Byte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector64_Byte testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector64_Byte testClass)
+            {
+                fixed (Vector64<Byte>* pFld1 = &_fld1)
+                fixed (Vector64<Byte>* pFld2 = &_fld2)
+                fixed (Vector64<Byte>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector64((Byte*)(pFld1)),
+                        AdvSimd.LoadVector64((Byte*)(pFld2)),
+                        AdvSimd.LoadVector64((Byte*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 8;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Byte>>() / sizeof(Byte);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Byte>>() / sizeof(Byte);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<Byte>>() / sizeof(Byte);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Byte>>() / 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 Vector64<Byte> _clsVar1;
+        private static Vector64<Byte> _clsVar2;
+        private static Vector64<Byte> _clsVar3;
+
+        private Vector64<Byte> _fld1;
+        private Vector64<Byte> _fld2;
+        private Vector64<Byte> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector64_Byte()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _clsVar1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _clsVar2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _clsVar3), ref Unsafe.As<Byte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector64_Byte()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _fld3), ref Unsafe.As<Byte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector64<Byte>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector64<Byte>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector64<Byte>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector64((Byte*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<Byte>), typeof(Vector64<Byte>), typeof(Vector64<Byte>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector64<Byte>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector64<Byte>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector64<Byte>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Byte>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<Byte>), typeof(Vector64<Byte>), typeof(Vector64<Byte>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Byte>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector64<Byte>* pClsVar1 = &_clsVar1)
+            fixed (Vector64<Byte>* pClsVar2 = &_clsVar2)
+            fixed (Vector64<Byte>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Byte*)(pClsVar1)),
+                    AdvSimd.LoadVector64((Byte*)(pClsVar2)),
+                    AdvSimd.LoadVector64((Byte*)(pClsVar3))
+                );
+
+                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<Vector64<Byte>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector64<Byte>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector64<Byte>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector64_Byte();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_Byte();
+
+            fixed (Vector64<Byte>* pFld1 = &test._fld1)
+            fixed (Vector64<Byte>* pFld2 = &test._fld2)
+            fixed (Vector64<Byte>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Byte*)(pFld1)),
+                    AdvSimd.LoadVector64((Byte*)(pFld2)),
+                    AdvSimd.LoadVector64((Byte*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector64<Byte>* pFld1 = &_fld1)
+            fixed (Vector64<Byte>* pFld2 = &_fld2)
+            fixed (Vector64<Byte>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Byte*)(pFld1)),
+                    AdvSimd.LoadVector64((Byte*)(pFld2)),
+                    AdvSimd.LoadVector64((Byte*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((Byte*)(&test._fld1)),
+                AdvSimd.LoadVector64((Byte*)(&test._fld2)),
+                AdvSimd.LoadVector64((Byte*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector64<Byte> op1, Vector64<Byte> op2, Vector64<Byte> 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<Byte, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+
+            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<Byte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Byte>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Byte[] firstOp, Byte[] secondOp, Byte[] thirdOp, Byte[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Byte>(Vector64<Byte>, Vector64<Byte>, Vector64<Byte>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Int16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Int16.cs
new file mode 100644 (file)
index 0000000..d92355b
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector64_Int16()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_Int16();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector64_Int16
+    {
+        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<Int16>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int16>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int16>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int16>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Int16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int16, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int16, byte>(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 Vector64<Int16> _fld1;
+            public Vector64<Int16> _fld2;
+            public Vector64<Int16> _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<Vector64<Int16>, byte>(ref testStruct._fld1), ref Unsafe.As<Int16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref testStruct._fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref testStruct._fld3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector64_Int16 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector64_Int16 testClass)
+            {
+                fixed (Vector64<Int16>* pFld1 = &_fld1)
+                fixed (Vector64<Int16>* pFld2 = &_fld2)
+                fixed (Vector64<Int16>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector64((Int16*)(pFld1)),
+                        AdvSimd.LoadVector64((Int16*)(pFld2)),
+                        AdvSimd.LoadVector64((Int16*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 8;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int16>>() / sizeof(Int16);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int16>>() / sizeof(Int16);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<Int16>>() / sizeof(Int16);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int16>>() / 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 Vector64<Int16> _clsVar1;
+        private static Vector64<Int16> _clsVar2;
+        private static Vector64<Int16> _clsVar3;
+
+        private Vector64<Int16> _fld1;
+        private Vector64<Int16> _fld2;
+        private Vector64<Int16> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector64_Int16()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _clsVar1), ref Unsafe.As<Int16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _clsVar2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _clsVar3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector64_Int16()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _fld1), ref Unsafe.As<Int16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _fld3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector64<Int16>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector64<Int16>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector64<Int16>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector64((Int16*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<Int16>), typeof(Vector64<Int16>), typeof(Vector64<Int16>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector64<Int16>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector64<Int16>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector64<Int16>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int16>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<Int16>), typeof(Vector64<Int16>), typeof(Vector64<Int16>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int16>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector64<Int16>* pClsVar1 = &_clsVar1)
+            fixed (Vector64<Int16>* pClsVar2 = &_clsVar2)
+            fixed (Vector64<Int16>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Int16*)(pClsVar1)),
+                    AdvSimd.LoadVector64((Int16*)(pClsVar2)),
+                    AdvSimd.LoadVector64((Int16*)(pClsVar3))
+                );
+
+                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<Vector64<Int16>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector64<Int16>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector64<Int16>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector64_Int16();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_Int16();
+
+            fixed (Vector64<Int16>* pFld1 = &test._fld1)
+            fixed (Vector64<Int16>* pFld2 = &test._fld2)
+            fixed (Vector64<Int16>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Int16*)(pFld1)),
+                    AdvSimd.LoadVector64((Int16*)(pFld2)),
+                    AdvSimd.LoadVector64((Int16*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector64<Int16>* pFld1 = &_fld1)
+            fixed (Vector64<Int16>* pFld2 = &_fld2)
+            fixed (Vector64<Int16>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Int16*)(pFld1)),
+                    AdvSimd.LoadVector64((Int16*)(pFld2)),
+                    AdvSimd.LoadVector64((Int16*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((Int16*)(&test._fld1)),
+                AdvSimd.LoadVector64((Int16*)(&test._fld2)),
+                AdvSimd.LoadVector64((Int16*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector64<Int16> op1, Vector64<Int16> op2, Vector64<Int16> 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<Int16, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+
+            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<Int16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int16>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Int16[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int16[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Int16>(Vector64<Int16>, Vector64<Int16>, Vector64<Int16>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Int32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Int32.cs
new file mode 100644 (file)
index 0000000..51ec009
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector64_Int32()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_Int32();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector64_Int32
+    {
+        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<Int32>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int32>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int32, byte>(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 Vector64<Int32> _fld1;
+            public Vector64<Int32> _fld2;
+            public Vector64<Int32> _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<Vector64<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector64_Int32 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector64_Int32 testClass)
+            {
+                fixed (Vector64<Int32>* pFld1 = &_fld1)
+                fixed (Vector64<Int32>* pFld2 = &_fld2)
+                fixed (Vector64<Int32>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector64((Int32*)(pFld1)),
+                        AdvSimd.LoadVector64((Int32*)(pFld2)),
+                        AdvSimd.LoadVector64((Int32*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 8;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int32>>() / 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 Vector64<Int32> _clsVar1;
+        private static Vector64<Int32> _clsVar2;
+        private static Vector64<Int32> _clsVar3;
+
+        private Vector64<Int32> _fld1;
+        private Vector64<Int32> _fld2;
+        private Vector64<Int32> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector64_Int32()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector64_Int32()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector64<Int32>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector64((Int32*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>), typeof(Vector64<Int32>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector64<Int32>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>), typeof(Vector64<Int32>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector64<Int32>* pClsVar1 = &_clsVar1)
+            fixed (Vector64<Int32>* pClsVar2 = &_clsVar2)
+            fixed (Vector64<Int32>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Int32*)(pClsVar1)),
+                    AdvSimd.LoadVector64((Int32*)(pClsVar2)),
+                    AdvSimd.LoadVector64((Int32*)(pClsVar3))
+                );
+
+                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<Vector64<Int32>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector64_Int32();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_Int32();
+
+            fixed (Vector64<Int32>* pFld1 = &test._fld1)
+            fixed (Vector64<Int32>* pFld2 = &test._fld2)
+            fixed (Vector64<Int32>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Int32*)(pFld1)),
+                    AdvSimd.LoadVector64((Int32*)(pFld2)),
+                    AdvSimd.LoadVector64((Int32*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector64<Int32>* pFld1 = &_fld1)
+            fixed (Vector64<Int32>* pFld2 = &_fld2)
+            fixed (Vector64<Int32>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Int32*)(pFld1)),
+                    AdvSimd.LoadVector64((Int32*)(pFld2)),
+                    AdvSimd.LoadVector64((Int32*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((Int32*)(&test._fld1)),
+                AdvSimd.LoadVector64((Int32*)(&test._fld2)),
+                AdvSimd.LoadVector64((Int32*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector64<Int32> op1, Vector64<Int32> op2, Vector64<Int32> 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<Int32, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+
+            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<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Int32[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int32[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Int32>(Vector64<Int32>, Vector64<Int32>, Vector64<Int32>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.SByte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.SByte.cs
new file mode 100644 (file)
index 0000000..e3f9432
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector64_SByte()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_SByte();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector64_SByte
+    {
+        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<SByte>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<SByte>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<SByte>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<SByte>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<SByte, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<SByte, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<SByte, byte>(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 Vector64<SByte> _fld1;
+            public Vector64<SByte> _fld2;
+            public Vector64<SByte> _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<Vector64<SByte>, byte>(ref testStruct._fld1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<SByte>, byte>(ref testStruct._fld2), ref Unsafe.As<SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<SByte>, byte>(ref testStruct._fld3), ref Unsafe.As<SByte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector64_SByte testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector64_SByte testClass)
+            {
+                fixed (Vector64<SByte>* pFld1 = &_fld1)
+                fixed (Vector64<SByte>* pFld2 = &_fld2)
+                fixed (Vector64<SByte>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector64((SByte*)(pFld1)),
+                        AdvSimd.LoadVector64((SByte*)(pFld2)),
+                        AdvSimd.LoadVector64((SByte*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 8;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<SByte>>() / sizeof(SByte);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<SByte>>() / sizeof(SByte);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<SByte>>() / sizeof(SByte);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<SByte>>() / 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 Vector64<SByte> _clsVar1;
+        private static Vector64<SByte> _clsVar2;
+        private static Vector64<SByte> _clsVar3;
+
+        private Vector64<SByte> _fld1;
+        private Vector64<SByte> _fld2;
+        private Vector64<SByte> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector64_SByte()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<SByte>, byte>(ref _clsVar1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<SByte>, byte>(ref _clsVar2), ref Unsafe.As<SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<SByte>, byte>(ref _clsVar3), ref Unsafe.As<SByte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector64_SByte()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<SByte>, byte>(ref _fld1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<SByte>, byte>(ref _fld2), ref Unsafe.As<SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSByte(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<SByte>, byte>(ref _fld3), ref Unsafe.As<SByte, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector64<SByte>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector64<SByte>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector64<SByte>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector64((SByte*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<SByte>), typeof(Vector64<SByte>), typeof(Vector64<SByte>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector64<SByte>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector64<SByte>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector64<SByte>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<SByte>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<SByte>), typeof(Vector64<SByte>), typeof(Vector64<SByte>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<SByte>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector64<SByte>* pClsVar1 = &_clsVar1)
+            fixed (Vector64<SByte>* pClsVar2 = &_clsVar2)
+            fixed (Vector64<SByte>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((SByte*)(pClsVar1)),
+                    AdvSimd.LoadVector64((SByte*)(pClsVar2)),
+                    AdvSimd.LoadVector64((SByte*)(pClsVar3))
+                );
+
+                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<Vector64<SByte>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector64<SByte>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector64<SByte>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector64_SByte();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_SByte();
+
+            fixed (Vector64<SByte>* pFld1 = &test._fld1)
+            fixed (Vector64<SByte>* pFld2 = &test._fld2)
+            fixed (Vector64<SByte>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((SByte*)(pFld1)),
+                    AdvSimd.LoadVector64((SByte*)(pFld2)),
+                    AdvSimd.LoadVector64((SByte*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector64<SByte>* pFld1 = &_fld1)
+            fixed (Vector64<SByte>* pFld2 = &_fld2)
+            fixed (Vector64<SByte>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((SByte*)(pFld1)),
+                    AdvSimd.LoadVector64((SByte*)(pFld2)),
+                    AdvSimd.LoadVector64((SByte*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((SByte*)(&test._fld1)),
+                AdvSimd.LoadVector64((SByte*)(&test._fld2)),
+                AdvSimd.LoadVector64((SByte*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector64<SByte> op1, Vector64<SByte> op2, Vector64<SByte> 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<SByte, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+
+            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<SByte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<SByte>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(SByte[] firstOp, SByte[] secondOp, SByte[] thirdOp, SByte[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<SByte>(Vector64<SByte>, Vector64<SByte>, Vector64<SByte>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.Single.cs
new file mode 100644 (file)
index 0000000..f5196c0
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector64_Single()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_Single();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector64_Single
+    {
+        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<Single>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Single>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Single>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Single, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Single, byte>(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 Vector64<Single> _fld1;
+            public Vector64<Single> _fld2;
+            public Vector64<Single> _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<Vector64<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref testStruct._fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref testStruct._fld3), ref Unsafe.As<Single, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector64_Single testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector64_Single testClass)
+            {
+                fixed (Vector64<Single>* pFld1 = &_fld1)
+                fixed (Vector64<Single>* pFld2 = &_fld2)
+                fixed (Vector64<Single>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector64((Single*)(pFld1)),
+                        AdvSimd.LoadVector64((Single*)(pFld2)),
+                        AdvSimd.LoadVector64((Single*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 8;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Single>>() / 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 Vector64<Single> _clsVar1;
+        private static Vector64<Single> _clsVar2;
+        private static Vector64<Single> _clsVar3;
+
+        private Vector64<Single> _fld1;
+        private Vector64<Single> _fld2;
+        private Vector64<Single> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector64_Single()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _clsVar3), ref Unsafe.As<Single, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector64_Single()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _fld3), ref Unsafe.As<Single, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector64<Single>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector64<Single>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector64((Single*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<Single>), typeof(Vector64<Single>), typeof(Vector64<Single>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector64<Single>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector64<Single>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<Single>), typeof(Vector64<Single>), typeof(Vector64<Single>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector64<Single>* pClsVar1 = &_clsVar1)
+            fixed (Vector64<Single>* pClsVar2 = &_clsVar2)
+            fixed (Vector64<Single>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Single*)(pClsVar1)),
+                    AdvSimd.LoadVector64((Single*)(pClsVar2)),
+                    AdvSimd.LoadVector64((Single*)(pClsVar3))
+                );
+
+                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<Vector64<Single>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector64<Single>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector64<Single>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector64_Single();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_Single();
+
+            fixed (Vector64<Single>* pFld1 = &test._fld1)
+            fixed (Vector64<Single>* pFld2 = &test._fld2)
+            fixed (Vector64<Single>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Single*)(pFld1)),
+                    AdvSimd.LoadVector64((Single*)(pFld2)),
+                    AdvSimd.LoadVector64((Single*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector64<Single>* pFld1 = &_fld1)
+            fixed (Vector64<Single>* pFld2 = &_fld2)
+            fixed (Vector64<Single>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((Single*)(pFld1)),
+                    AdvSimd.LoadVector64((Single*)(pFld2)),
+                    AdvSimd.LoadVector64((Single*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((Single*)(&test._fld1)),
+                AdvSimd.LoadVector64((Single*)(&test._fld2)),
+                AdvSimd.LoadVector64((Single*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector64<Single> op1, Vector64<Single> op2, Vector64<Single> 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<Single, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
+
+            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<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(Single[] firstOp, Single[] secondOp, Single[] thirdOp, Single[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<Single>(Vector64<Single>, Vector64<Single>, Vector64<Single>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.UInt16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.UInt16.cs
new file mode 100644 (file)
index 0000000..6b4be77
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector64_UInt16()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt16();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt16
+    {
+        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<UInt16>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt16>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<UInt16>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt16, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<UInt16, byte>(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 Vector64<UInt16> _fld1;
+            public Vector64<UInt16> _fld2;
+            public Vector64<UInt16> _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<Vector64<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref testStruct._fld3), ref Unsafe.As<UInt16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt16 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt16 testClass)
+            {
+                fixed (Vector64<UInt16>* pFld1 = &_fld1)
+                fixed (Vector64<UInt16>* pFld2 = &_fld2)
+                fixed (Vector64<UInt16>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector64((UInt16*)(pFld1)),
+                        AdvSimd.LoadVector64((UInt16*)(pFld2)),
+                        AdvSimd.LoadVector64((UInt16*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 8;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / 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 Vector64<UInt16> _clsVar1;
+        private static Vector64<UInt16> _clsVar2;
+        private static Vector64<UInt16> _clsVar3;
+
+        private Vector64<UInt16> _fld1;
+        private Vector64<UInt16> _fld2;
+        private Vector64<UInt16> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt16()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _clsVar2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _clsVar3), ref Unsafe.As<UInt16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt16()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt16(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _fld3), ref Unsafe.As<UInt16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector64((UInt16*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<UInt16>), typeof(Vector64<UInt16>), typeof(Vector64<UInt16>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt16>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<UInt16>), typeof(Vector64<UInt16>), typeof(Vector64<UInt16>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt16>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector64<UInt16>* pClsVar1 = &_clsVar1)
+            fixed (Vector64<UInt16>* pClsVar2 = &_clsVar2)
+            fixed (Vector64<UInt16>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((UInt16*)(pClsVar1)),
+                    AdvSimd.LoadVector64((UInt16*)(pClsVar2)),
+                    AdvSimd.LoadVector64((UInt16*)(pClsVar3))
+                );
+
+                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<Vector64<UInt16>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector64((UInt16*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt16();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt16();
+
+            fixed (Vector64<UInt16>* pFld1 = &test._fld1)
+            fixed (Vector64<UInt16>* pFld2 = &test._fld2)
+            fixed (Vector64<UInt16>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((UInt16*)(pFld1)),
+                    AdvSimd.LoadVector64((UInt16*)(pFld2)),
+                    AdvSimd.LoadVector64((UInt16*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector64<UInt16>* pFld1 = &_fld1)
+            fixed (Vector64<UInt16>* pFld2 = &_fld2)
+            fixed (Vector64<UInt16>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((UInt16*)(pFld1)),
+                    AdvSimd.LoadVector64((UInt16*)(pFld2)),
+                    AdvSimd.LoadVector64((UInt16*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((UInt16*)(&test._fld1)),
+                AdvSimd.LoadVector64((UInt16*)(&test._fld2)),
+                AdvSimd.LoadVector64((UInt16*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector64<UInt16> op1, Vector64<UInt16> op2, Vector64<UInt16> 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<UInt16, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+
+            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<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(UInt16[] firstOp, UInt16[] secondOp, UInt16[] thirdOp, UInt16[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<UInt16>(Vector64<UInt16>, Vector64<UInt16>, Vector64<UInt16>): {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/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.UInt32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/AdvSimd/BitwiseSelect.Vector64.UInt32.cs
new file mode 100644 (file)
index 0000000..ca8d19d
--- /dev/null
@@ -0,0 +1,578 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void BitwiseSelect_Vector64_UInt32()
+        {
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt32();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if (AdvSimd.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt32
+    {
+        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<UInt32>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt32>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<UInt32>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt32>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<UInt32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<UInt32, byte>(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 Vector64<UInt32> _fld1;
+            public Vector64<UInt32> _fld2;
+            public Vector64<UInt32> _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<Vector64<UInt32>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref testStruct._fld3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario(SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt32 testClass)
+            {
+                var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load(SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt32 testClass)
+            {
+                fixed (Vector64<UInt32>* pFld1 = &_fld1)
+                fixed (Vector64<UInt32>* pFld2 = &_fld2)
+                fixed (Vector64<UInt32>* pFld3 = &_fld3)
+                {
+                    var result = AdvSimd.BitwiseSelect(
+                        AdvSimd.LoadVector64((UInt32*)(pFld1)),
+                        AdvSimd.LoadVector64((UInt32*)(pFld2)),
+                        AdvSimd.LoadVector64((UInt32*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = 8;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / sizeof(UInt32);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / sizeof(UInt32);
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / sizeof(UInt32);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / 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 Vector64<UInt32> _clsVar1;
+        private static Vector64<UInt32> _clsVar2;
+        private static Vector64<UInt32> _clsVar3;
+
+        private Vector64<UInt32> _fld1;
+        private Vector64<UInt32> _fld2;
+        private Vector64<UInt32> _fld3;
+
+        private DataTable _dataTable;
+
+        static SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt32()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _clsVar1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _clsVar2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _clsVar3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+        }
+
+        public SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt32()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetUInt32(); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _fld3), ref Unsafe.As<UInt32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+
+            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 IsSupported => AdvSimd.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = AdvSimd.BitwiseSelect(
+                Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)),
+                AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)),
+                AdvSimd.LoadVector64((UInt32*)(_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 result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<UInt32>), typeof(Vector64<UInt32>), typeof(Vector64<UInt32>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt32>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.BitwiseSelect), new Type[] { typeof(Vector64<UInt32>), typeof(Vector64<UInt32>), typeof(Vector64<UInt32>) })
+                                     .Invoke(null, new object[] {
+                                        AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr)),
+                                        AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr)),
+                                        AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt32>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = AdvSimd.BitwiseSelect(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed (Vector64<UInt32>* pClsVar1 = &_clsVar1)
+            fixed (Vector64<UInt32>* pClsVar2 = &_clsVar2)
+            fixed (Vector64<UInt32>* pClsVar3 = &_clsVar3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((UInt32*)(pClsVar1)),
+                    AdvSimd.LoadVector64((UInt32*)(pClsVar2)),
+                    AdvSimd.LoadVector64((UInt32*)(pClsVar3))
+                );
+
+                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<Vector64<UInt32>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray3Ptr);
+            var result = AdvSimd.BitwiseSelect(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray1Ptr));
+            var op2 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray2Ptr));
+            var op3 = AdvSimd.LoadVector64((UInt32*)(_dataTable.inArray3Ptr));
+            var result = AdvSimd.BitwiseSelect(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 SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt32();
+            var result = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new SimpleTernaryOpTest__BitwiseSelect_Vector64_UInt32();
+
+            fixed (Vector64<UInt32>* pFld1 = &test._fld1)
+            fixed (Vector64<UInt32>* pFld2 = &test._fld2)
+            fixed (Vector64<UInt32>* pFld3 = &test._fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((UInt32*)(pFld1)),
+                    AdvSimd.LoadVector64((UInt32*)(pFld2)),
+                    AdvSimd.LoadVector64((UInt32*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = AdvSimd.BitwiseSelect(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed (Vector64<UInt32>* pFld1 = &_fld1)
+            fixed (Vector64<UInt32>* pFld2 = &_fld2)
+            fixed (Vector64<UInt32>* pFld3 = &_fld3)
+            {
+                var result = AdvSimd.BitwiseSelect(
+                    AdvSimd.LoadVector64((UInt32*)(pFld1)),
+                    AdvSimd.LoadVector64((UInt32*)(pFld2)),
+                    AdvSimd.LoadVector64((UInt32*)(pFld3))
+                );
+
+                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 = AdvSimd.BitwiseSelect(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = AdvSimd.BitwiseSelect(
+                AdvSimd.LoadVector64((UInt32*)(&test._fld1)),
+                AdvSimd.LoadVector64((UInt32*)(&test._fld2)),
+                AdvSimd.LoadVector64((UInt32*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult(Vector64<UInt32> op1, Vector64<UInt32> op2, Vector64<UInt32> 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<UInt32, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+
+            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<UInt32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(UInt32[] firstOp, UInt32[] secondOp, UInt32[] thirdOp, UInt32[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0])
+            {
+                succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.BitwiseSelect)}<UInt32>(Vector64<UInt32>, Vector64<UInt32>, Vector64<UInt32>): {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;
+            }
+        }
+    }
+}
index a38c737..e29395e 100644 (file)
@@ -38,6 +38,23 @@ namespace JIT.HardwareIntrinsics.Arm
                 ["Add.Vector128.UInt32"] = Add_Vector128_UInt32,
                 ["Add.Vector128.UInt64"] = Add_Vector128_UInt64,
                 ["AddScalar.Vector64.Single"] = AddScalar_Vector64_Single,
+                ["BitwiseSelect.Vector64.Byte"] = BitwiseSelect_Vector64_Byte,
+                ["BitwiseSelect.Vector64.Int16"] = BitwiseSelect_Vector64_Int16,
+                ["BitwiseSelect.Vector64.Int32"] = BitwiseSelect_Vector64_Int32,
+                ["BitwiseSelect.Vector64.SByte"] = BitwiseSelect_Vector64_SByte,
+                ["BitwiseSelect.Vector64.Single"] = BitwiseSelect_Vector64_Single,
+                ["BitwiseSelect.Vector64.UInt16"] = BitwiseSelect_Vector64_UInt16,
+                ["BitwiseSelect.Vector64.UInt32"] = BitwiseSelect_Vector64_UInt32,
+                ["BitwiseSelect.Vector128.Byte"] = BitwiseSelect_Vector128_Byte,
+                ["BitwiseSelect.Vector128.Double"] = BitwiseSelect_Vector128_Double,
+                ["BitwiseSelect.Vector128.Int16"] = BitwiseSelect_Vector128_Int16,
+                ["BitwiseSelect.Vector128.Int32"] = BitwiseSelect_Vector128_Int32,
+                ["BitwiseSelect.Vector128.Int64"] = BitwiseSelect_Vector128_Int64,
+                ["BitwiseSelect.Vector128.SByte"] = BitwiseSelect_Vector128_SByte,
+                ["BitwiseSelect.Vector128.Single"] = BitwiseSelect_Vector128_Single,
+                ["BitwiseSelect.Vector128.UInt16"] = BitwiseSelect_Vector128_UInt16,
+                ["BitwiseSelect.Vector128.UInt32"] = BitwiseSelect_Vector128_UInt32,
+                ["BitwiseSelect.Vector128.UInt64"] = BitwiseSelect_Vector128_UInt64,
                 ["LeadingSignCount.Vector64.Int16"] = LeadingSignCount_Vector64_Int16,
                 ["LeadingSignCount.Vector64.Int32"] = LeadingSignCount_Vector64_Int32,
                 ["LeadingSignCount.Vector64.SByte"] = LeadingSignCount_Vector64_SByte,
index c01e4a5..52c7baf 100644 (file)
@@ -49,77 +49,98 @@ private const string SimpleVecOpTest_ValidationLogic = @"
 private static readonly (string templateFileName, string outputTemplateName, Dictionary<string, string> templateData)[] Templates = new[]
 {
     ("_BinaryOpTestTemplate.template",        "SimpleBinOpTest.template",       new Dictionary<string, string> { ["TemplateName"] = "Simple",      ["TemplateValidationLogic"] = SimpleOpTest_ValidationLogic }),
+    ("_TernaryOpTestTemplate.template",       "SimpleTernOpTest.template",      new Dictionary<string, string> { ["TemplateName"] = "Simple",      ["TemplateValidationLogic"] = SimpleOpTest_ValidationLogic }),
     ("_UnaryOpTestTemplate.template",         "SimpleUnOpTest.template",        new Dictionary<string, string> { ["TemplateName"] = "Simple",      ["TemplateValidationLogic"] = SimpleOpTest_ValidationLogic }),
     ("_UnaryOpTestTemplate.template",         "SimpleVecOpTest.template",       new Dictionary<string, string> { ["TemplateName"] = "Simple",      ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic }),
 };
 
 private static readonly (string templateFileName, Dictionary<string, string> templateData)[] AdvSimdInputs = new []
 {
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector64_Byte",                ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()",                                                         ["ValidateFirstResult"] = "result[0] != (byte)Math.Abs(firstOp[0])",                                                                                            ["ValidateRemainingResults"] = "result[i] != (byte)Math.Abs(firstOp[i])"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector64_UInt16",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()",                                                         ["ValidateFirstResult"] = "result[0] != (ushort)Math.Abs(firstOp[0])",                                                                                          ["ValidateRemainingResults"] = "result[i] != (ushort)Math.Abs(firstOp[i])"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector64_UInt32",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "-TestLibrary.Generator.GetInt32()",                                                                ["ValidateFirstResult"] = "result[0] != (uint)Math.Abs(firstOp[0])",                                                                                            ["ValidateRemainingResults"] = "result[i] != (uint)Math.Abs(firstOp[i])"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector64_Single",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()",                                                               ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[0]))",                                  ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[i]))"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector128_Byte",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()",                                                         ["ValidateFirstResult"] = "result[0] != (byte)Math.Abs(firstOp[0])",                                                                                            ["ValidateRemainingResults"] = "result[i] != (byte)Math.Abs(firstOp[i])"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector128_Single",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()",                                                               ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[0]))",                                  ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[i]))"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector128_UInt16",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()",                                                         ["ValidateFirstResult"] = "result[0] != (ushort)Math.Abs(firstOp[0])",                                                                                          ["ValidateRemainingResults"] = "result[i] != (ushort)Math.Abs(firstOp[i])"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector128_UInt32",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt32()",                                                                ["ValidateFirstResult"] = "result[0] != (uint)Math.Abs(firstOp[0])",                                                                                            ["ValidateRemainingResults"] = "result[i] != (uint)Math.Abs(firstOp[i])"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "AbsScalar_Vector64_Single",        ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsScalar",                                ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()",                                                               ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[0]))",                                  ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_Byte",                ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Byte",   ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Byte",   ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",          ["NextValueOp2"] = "TestLibrary.Generator.GetByte()",   ["ValidateFirstResult"] = "(byte)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(byte)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_Int16",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Int16",  ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()",  ["ValidateFirstResult"] = "(short)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(short)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_Int32",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Int32",  ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()",  ["ValidateFirstResult"] = "(int)(left[0] + right[0]) != result[0]",                                                                                             ["ValidateRemainingResults"] = "(int)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_SByte",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "SByte",  ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",         ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()",  ["ValidateFirstResult"] = "(sbyte)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(sbyte)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_Single",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",        ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])",                                    ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(left[i] + right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_UInt16",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "(ushort)(left[0] + right[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "(ushort)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_UInt32",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "(uint)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(uint)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Byte",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte",   ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",          ["NextValueOp2"] = "TestLibrary.Generator.GetByte()",   ["ValidateFirstResult"] = "(byte)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(byte)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Int16",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16",  ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()",  ["ValidateFirstResult"] = "(short)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(short)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Int32",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32",  ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()",  ["ValidateFirstResult"] = "(int)(left[0] + right[0]) != result[0]",                                                                                             ["ValidateRemainingResults"] = "(int)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Int64",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64",  ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()",  ["ValidateFirstResult"] = "(long)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(long)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_SByte",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte",  ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",         ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()",  ["ValidateFirstResult"] = "(sbyte)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(sbyte)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Single",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",        ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])",                                    ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(left[i] + right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_UInt16",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "(ushort)(left[0] + right[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "(ushort)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_UInt32",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "(uint)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(uint)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_UInt64",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "(ulong)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(ulong)(left[i] + right[i]) != result[i]"}),
-    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "AddScalar_Vector64_Single",        ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar",                                ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",        ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])",                                    ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector64_Int16",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()",                                                         ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector64_Int32",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "-TestLibrary.Generator.GetInt32()",                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector64_SByte",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()",                                                         ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()",                                                         ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt32()",                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()",                                                         ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_Byte",   ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Byte",                                                                ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                  ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_Int16",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_Int32",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_SByte",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt16",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt32",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_Byte",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte",                                                                ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                  ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_UInt16",["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_UInt32",["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_Byte",                ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Byte",                                                                ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                  ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_Int16",               ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_Int32",               ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_SByte",               ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_Single",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",                                                                ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])",                                            ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_UInt16",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt16",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_UInt32",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt32",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Byte",               ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte",                                                                ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                  ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Double",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()",                                                                ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])",                                            ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Int16",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Int32",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Int64",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()",                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_SByte",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Single",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",                                                                ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])",                                            ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_UInt16",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_UInt32",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_UInt64",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()",                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "PopCount_Vector64_Byte",           ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount",                                 ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Byte",                                                                ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                  ["ValidateFirstResult"] = "Helpers.BitCount(firstOp[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "Helpers.BitCount(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "PopCount_Vector64_SByte",          ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount",                                 ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                 ["ValidateFirstResult"] = "Helpers.BitCount(firstOp[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "Helpers.BitCount(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "PopCount_Vector128_Byte",          ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount",                                 ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte",                                                                ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                  ["ValidateFirstResult"] = "Helpers.BitCount(firstOp[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "Helpers.BitCount(firstOp[i]) != result[i]"}),
-    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "PopCount_Vector128_SByte",         ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount",                                 ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                 ["ValidateFirstResult"] = "Helpers.BitCount(firstOp[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "Helpers.BitCount(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector64_Byte",                ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()",                                                                                                                         ["ValidateFirstResult"] = "result[0] != (byte)Math.Abs(firstOp[0])",                                                                                            ["ValidateRemainingResults"] = "result[i] != (byte)Math.Abs(firstOp[i])"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector64_UInt16",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()",                                                                                                                         ["ValidateFirstResult"] = "result[0] != (ushort)Math.Abs(firstOp[0])",                                                                                          ["ValidateRemainingResults"] = "result[i] != (ushort)Math.Abs(firstOp[i])"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector64_UInt32",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "-TestLibrary.Generator.GetInt32()",                                                                                                                                ["ValidateFirstResult"] = "result[0] != (uint)Math.Abs(firstOp[0])",                                                                                            ["ValidateRemainingResults"] = "result[i] != (uint)Math.Abs(firstOp[i])"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector64_Single",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single",                                                                                                                          ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()",                                                                                                                               ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[0]))",                                  ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[i]))"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector128_Byte",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()",                                                                                                                         ["ValidateFirstResult"] = "result[0] != (byte)Math.Abs(firstOp[0])",                                                                                            ["ValidateRemainingResults"] = "result[i] != (byte)Math.Abs(firstOp[i])"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector128_Single",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single",                                                                                                                          ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()",                                                                                                                               ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[0]))",                                  ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[i]))"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector128_UInt16",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()",                                                                                                                         ["ValidateFirstResult"] = "result[0] != (ushort)Math.Abs(firstOp[0])",                                                                                          ["ValidateRemainingResults"] = "result[i] != (ushort)Math.Abs(firstOp[i])"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "Abs_Vector128_UInt32",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Abs",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt32()",                                                                                                                                ["ValidateFirstResult"] = "result[0] != (uint)Math.Abs(firstOp[0])",                                                                                            ["ValidateRemainingResults"] = "result[i] != (uint)Math.Abs(firstOp[i])"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "AbsScalar_Vector64_Single",        ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AbsScalar",                                ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single",                                                                                                                          ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "-TestLibrary.Generator.GetSingle()",                                                                                                                               ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(Math.Abs(firstOp[0]))",                                  ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_Byte",                ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Byte",   ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Byte",                                                               ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",          ["NextValueOp2"] = "TestLibrary.Generator.GetByte()",                                                                   ["ValidateFirstResult"] = "(byte)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(byte)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_Int16",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Int16",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()",                                                                  ["ValidateFirstResult"] = "(short)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(short)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_Int32",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Int32",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()",                                                                  ["ValidateFirstResult"] = "(int)(left[0] + right[0]) != result[0]",                                                                                             ["ValidateRemainingResults"] = "(int)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_SByte",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "SByte",                                                              ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",         ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()",                                                                  ["ValidateFirstResult"] = "(sbyte)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(sbyte)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_Single",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Single",                                                             ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",        ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()",                                                                 ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])",                                    ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(left[i] + right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_UInt16",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "UInt16",                                                             ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()",                                                                 ["ValidateFirstResult"] = "(ushort)(left[0] + right[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "(ushort)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector64_UInt32",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "UInt32",                                                             ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()",                                                                 ["ValidateFirstResult"] = "(uint)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(uint)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Byte",               ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte",   ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte",                                                               ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",          ["NextValueOp2"] = "TestLibrary.Generator.GetByte()",                                                                   ["ValidateFirstResult"] = "(byte)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(byte)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Int16",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()",                                                                  ["ValidateFirstResult"] = "(short)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(short)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Int32",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()",                                                                  ["ValidateFirstResult"] = "(int)(left[0] + right[0]) != result[0]",                                                                                             ["ValidateRemainingResults"] = "(int)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Int64",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()",                                                                  ["ValidateFirstResult"] = "(long)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(long)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_SByte",              ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte",                                                              ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",         ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()",                                                                  ["ValidateFirstResult"] = "(sbyte)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(sbyte)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_Single",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                             ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",        ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()",                                                                 ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])",                                    ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(left[i] + right[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_UInt16",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16",                                                             ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()",                                                                 ["ValidateFirstResult"] = "(ushort)(left[0] + right[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "(ushort)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_UInt32",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32",                                                             ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()",                                                                 ["ValidateFirstResult"] = "(uint)(left[0] + right[0]) != result[0]",                                                                                            ["ValidateRemainingResults"] = "(uint)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "Add_Vector128_UInt64",             ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "Add",                                      ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64",                                                             ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()",                                                                 ["ValidateFirstResult"] = "(ulong)(left[0] + right[0]) != result[0]",                                                                                           ["ValidateRemainingResults"] = "(ulong)(left[i] + right[i]) != result[i]"}),
+    ("SimpleBinOpTest.template",  new Dictionary<string, string> { ["TestName"] = "AddScalar_Vector64_Single",        ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "AddScalar",                                ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Single",                                                             ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",        ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()",                                                                 ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])",                                    ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != 0"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_Byte",      ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Byte",   ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Byte",   ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "Byte",  ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",          ["NextValueOp2"] = "TestLibrary.Generator.GetByte()",           ["NextValueOp3"] = "TestLibrary.Generator.GetByte()",   ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+//  ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_Double",    ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Double",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "Double",["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()",        ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()",         ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_Int16",     ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Int16",  ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()",          ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()",  ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_Int32",     ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Int32",  ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()",          ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()",  ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+//  ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_Int64",     ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int64",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int64",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Int64",  ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()",          ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()",  ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_SByte",     ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",  ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "SByte",  ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",         ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()",          ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()",  ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_Single",    ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "Single",["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",        ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()",         ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_UInt16",    ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "UInt16",["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()",         ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_UInt32",    ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "UInt32",["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()",         ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+//  ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector64_UInt64",    ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt64",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector64",  ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector64",  ["Op3BaseType"] = "UInt64",["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()",         ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_Byte",     ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte",   ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Byte",   ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Byte",  ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",          ["NextValueOp2"] = "TestLibrary.Generator.GetByte()",           ["NextValueOp3"] = "TestLibrary.Generator.GetByte()",   ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_Double",   ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Double",["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()",        ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()",         ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_Int16",    ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int16",  ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()",          ["NextValueOp3"] = "TestLibrary.Generator.GetInt16()",  ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_Int32",    ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32",  ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()",          ["NextValueOp3"] = "TestLibrary.Generator.GetInt32()",  ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_Int64",    ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64",  ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()",         ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()",          ["NextValueOp3"] = "TestLibrary.Generator.GetInt64()",  ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_SByte",    ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte",  ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",         ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()",          ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()",  ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_Single",   ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "Single",["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",        ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()",         ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_UInt16",   ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt16",["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()",         ["NextValueOp3"] = "TestLibrary.Generator.GetUInt16()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_UInt32",   ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt32", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt32",["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()",         ["NextValueOp3"] = "TestLibrary.Generator.GetUInt32()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleTernOpTest.template", new Dictionary<string, string> { ["TestName"] = "BitwiseSelect_Vector128_UInt64",   ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "BitwiseSelect",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt64", ["Op3VectorType"] = "Vector128", ["Op3BaseType"] = "UInt64",["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()",        ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()",         ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidateFirstResult"] = "Helpers.BitwiseSelect(firstOp[0], secondOp[0], thirdOp[0]) != result[0]",                                                            ["ValidateRemainingResults"] = "Helpers.BitwiseSelect(firstOp[i], secondOp[i], thirdOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector64_Int16",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()",                                                                                                                         ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector64_Int32",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "-TestLibrary.Generator.GetInt32()",                                                                                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector64_SByte",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()",                                                                                                                         ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(short)-TestLibrary.Generator.GetInt16()",                                                                                                                         ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt32()",                                                                                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingSignCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingSignCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)-TestLibrary.Generator.GetSByte()",                                                                                                                         ["ValidateFirstResult"] = "Helpers.CountLeadingSignBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingSignBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_Byte",   ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Byte",                                                                                                                            ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                                                                                  ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_Int16",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",                                                                                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_Int32",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",                                                                                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_SByte",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_UInt16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt16",                                                                                                                          ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",                                                                                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector64_UInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt32",                                                                                                                          ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",                                                                                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_Byte",  ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte",                                                                                                                            ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                                                                                  ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_Int16", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",                                                                                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_Int32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",                                                                                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                                                                                 ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_UInt16",["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16",                                                                                                                          ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",                                                                                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "LeadingZeroCount_Vector128_UInt32",["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LeadingZeroCount",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32",                                                                                                                          ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",                                                                                                                                ["ValidateFirstResult"] = "Helpers.CountLeadingZeroBits(firstOp[0]) != result[0]",                                                                              ["ValidateRemainingResults"] = "Helpers.CountLeadingZeroBits(firstOp[i]) != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_Byte",                ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Byte",                                                                                                                            ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                                                                                  ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_Int16",               ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int16",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",                                                                                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_Int32",               ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Int32",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",                                                                                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_SByte",               ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_Single",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Single",                                                                                                                          ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",                                                                                                                                ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])",                                            ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_UInt16",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt16",                                                                                                                          ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",                                                                                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector64_UInt32",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector64",                             ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "UInt32",                                                                                                                          ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",                                                                                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Byte",               ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte",                                                                                                                            ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                                                                                  ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Double",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double",                                                                                                                          ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()",                                                                                                                                ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])",                                            ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Int16",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int16",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()",                                                                                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Int32",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()",                                                                                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Int64",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()",                                                                                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_SByte",              ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                                                                                 ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_Single",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single",                                                                                                                          ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()",                                                                                                                                ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])",                                            ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(firstOp[i]) != BitConverter.SingleToInt32Bits(result[i])"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_UInt16",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16",                                                                                                                          ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()",                                                                                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_UInt32",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32",                                                                                                                          ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()",                                                                                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("LoadUnOpTest.template",     new Dictionary<string, string> { ["TestName"] = "LoadVector128_UInt64",             ["Isa"] = "AdvSimd",                          ["Method"] = "LoadVector128",                            ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64",  ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64",                                                                                                                          ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()",                                                                                                                                ["ValidateFirstResult"] = "firstOp[0] != result[0]",                                                                                                            ["ValidateRemainingResults"] = "firstOp[i] != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "PopCount_Vector64_Byte",           ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount",                                 ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "Byte",                                                                                                                            ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                                                                                  ["ValidateFirstResult"] = "Helpers.BitCount(firstOp[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "Helpers.BitCount(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "PopCount_Vector64_SByte",          ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount",                                 ["RetVectorType"] = "Vector64",  ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector64",  ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "8",  ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                                                                                 ["ValidateFirstResult"] = "Helpers.BitCount(firstOp[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "Helpers.BitCount(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "PopCount_Vector128_Byte",          ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount",                                 ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte",                                                                                                                            ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()",                                                                                                                                  ["ValidateFirstResult"] = "Helpers.BitCount(firstOp[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "Helpers.BitCount(firstOp[i]) != result[i]"}),
+    ("SimpleUnOpTest.template",   new Dictionary<string, string> { ["TestName"] = "PopCount_Vector128_SByte",         ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "PopCount",                                 ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte",                                                                                                                           ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()",                                                                                                                                 ["ValidateFirstResult"] = "Helpers.BitCount(firstOp[0]) != result[0]",                                                                                          ["ValidateRemainingResults"] = "Helpers.BitCount(firstOp[i]) != result[i]"}),
 };
 
 private static readonly (string templateFileName, Dictionary<string, string> templateData)[] AdvSimd_Arm64Inputs = new []
index 5696b57..4aed748 100644 (file)
@@ -183,6 +183,7 @@ namespace JIT.HardwareIntrinsics.Arm
 
             return (byte)result;
         }
+
         public static int ReverseElementBits(int op1)
         {
             uint val = (uint)op1;
@@ -200,6 +201,7 @@ namespace JIT.HardwareIntrinsics.Arm
 
             return (int)result;
         }
+
         public static long ReverseElementBits(long op1)
         {
             ulong val = (ulong)op1;
@@ -217,6 +219,7 @@ namespace JIT.HardwareIntrinsics.Arm
 
             return (long)result;
         }
+
         public static sbyte ReverseElementBits(sbyte op1)
         {
             byte val = (byte)op1;
@@ -234,6 +237,7 @@ namespace JIT.HardwareIntrinsics.Arm
 
             return (sbyte)result;
         }
+
         public static uint ReverseElementBits(uint op1)
         {
             uint val = (uint)op1;
@@ -251,6 +255,7 @@ namespace JIT.HardwareIntrinsics.Arm
 
             return (uint)result;
         }
+
         public static ulong ReverseElementBits(ulong op1)
         {
             ulong val = (ulong)op1;
@@ -268,5 +273,160 @@ namespace JIT.HardwareIntrinsics.Arm
 
             return (ulong)result;
         }
+
+        public static sbyte BitwiseSelect(sbyte op1, sbyte op2, sbyte op3)
+        {
+            ulong result = 0;
+
+            for (int i = 0; i < 8 * sizeof(sbyte); i++)
+            {
+                if (((ulong)op1 & (1UL << i)) != 0)
+                {
+                    result = result | ((ulong)op2 & (1UL << i));
+                }
+                else
+                {
+                    result = result | ((ulong)op3 & (1UL << i));
+                }
+            }
+
+            return (sbyte)result;
+        }
+
+        public static byte BitwiseSelect(byte op1, byte op2, byte op3)
+        {
+            ulong result = 0;
+
+            for (int i = 0; i < 8 * sizeof(byte); i++)
+            {
+                if (((ulong)op1 & (1UL << i)) != 0)
+                {
+                    result = result | ((ulong)op2 & (1UL << i));
+                }
+                else
+                {
+                    result = result | ((ulong)op3 & (1UL << i));
+                }
+            }
+
+            return (byte)result;
+        }
+
+        public static short BitwiseSelect(short op1, short op2, short op3)
+        {
+            ulong result = 0;
+
+            for (int i = 0; i < 8 * sizeof(short); i++)
+            {
+                if (((ulong)op1 & (1UL << i)) != 0)
+                {
+                    result = result | ((ulong)op2 & (1UL << i));
+                }
+                else
+                {
+                    result = result | ((ulong)op3 & (1UL << i));
+                }
+            }
+
+            return (short)result;
+        }
+
+        public static ushort BitwiseSelect(ushort op1, ushort op2, ushort op3)
+        {
+            ulong result = 0;
+
+            for (int i = 0; i < 8 * sizeof(ushort); i++)
+            {
+                if (((ulong)op1 & (1UL << i)) != 0)
+                {
+                    result = result | ((ulong)op2 & (1UL << i));
+                }
+                else
+                {
+                    result = result | ((ulong)op3 & (1UL << i));
+                }
+            }
+
+            return (ushort)result;
+        }
+
+        public static int BitwiseSelect(int op1, int op2, int op3)
+        {
+            ulong result = 0;
+
+            for (int i = 0; i < 8 * sizeof(int); i++)
+            {
+                if (((ulong)op1 & (1UL << i)) != 0)
+                {
+                    result = result | ((ulong)op2 & (1UL << i));
+                }
+                else
+                {
+                    result = result | ((ulong)op3 & (1UL << i));
+                }
+            }
+
+            return (int)result;
+        }
+
+        public static uint BitwiseSelect(uint op1, uint op2, uint op3)
+        {
+            ulong result = 0;
+
+            for (int i = 0; i < 8 * sizeof(uint); i++)
+            {
+                if (((ulong)op1 & (1UL << i)) != 0)
+                {
+                    result = result | ((ulong)op2 & (1UL << i));
+                }
+                else
+                {
+                    result = result | ((ulong)op3 & (1UL << i));
+                }
+            }
+
+            return (uint)result;
+        }
+
+        public static long BitwiseSelect(long op1, long op2, long op3)
+        {
+            ulong result = 0;
+
+            for (int i = 0; i < 8 * sizeof(long); i++)
+            {
+                if (((ulong)op1 & (1UL << i)) != 0)
+                {
+                    result = result | ((ulong)op2 & (1UL << i));
+                }
+                else
+                {
+                    result = result | ((ulong)op3 & (1UL << i));
+                }
+            }
+
+            return (long)result;
+        }
+
+        public static ulong BitwiseSelect(ulong op1, ulong op2, ulong op3)
+        {
+            ulong result = 0;
+
+            for (int i = 0; i < 8 * sizeof(ulong); i++)
+            {
+                if (((ulong)op1 & (1UL << i)) != 0)
+                {
+                    result = result | ((ulong)op2 & (1UL << i));
+                }
+                else
+                {
+                    result = result | ((ulong)op3 & (1UL << i));
+                }
+            }
+
+            return (ulong)result;
+        }
+
+        public static float BitwiseSelect(float op1, float op2, float op3) => BitConverter.Int32BitsToSingle(BitwiseSelect(BitConverter.SingleToInt32Bits(op1), BitConverter.SingleToInt32Bits(op2), BitConverter.SingleToInt32Bits(op3)));
+        public static double BitwiseSelect(double op1, double op2, double op3) => BitConverter.Int64BitsToDouble(BitwiseSelect(BitConverter.DoubleToInt64Bits(op1), BitConverter.DoubleToInt64Bits(op2), BitConverter.DoubleToInt64Bits(op3)));
     }
 }
index a6bb91d..0bf7f1e 100644 (file)
@@ -16,7 +16,6 @@ namespace JIT.HardwareIntrinsics.Arm
     static class Helpers
     {
 <#
-
         string[] typeNames = { "sbyte", "short", "int" };
         foreach (string typeName in typeNames)
         {
@@ -99,9 +98,36 @@ namespace JIT.HardwareIntrinsics.Arm
 
             return (<#= type.name #>)result;
         }
+
 <#
         }
 
+        foreach (string typeName in new string[] { "sbyte", "byte", "short", "ushort", "int", "uint", "long", "ulong" })
+        {
+#>
+        public static <#= typeName #> BitwiseSelect(<#= typeName #> op1, <#= typeName #> op2, <#= typeName #> op3)
+        {
+            ulong result = 0;
+
+            for (int i = 0; i < 8 * sizeof(<#= typeName #>); i++)
+            {
+                if (((ulong)op1 & (1UL << i)) != 0)
+                {
+                    result = result | ((ulong)op2 & (1UL << i));
+                }
+                else
+                {
+                    result = result | ((ulong)op3 & (1UL << i));
+                }
+            }
+
+            return (<#= typeName #>)result;
+        }
+
+<#
+        }
 #>
+        public static float BitwiseSelect(float op1, float op2, float op3) => BitConverter.Int32BitsToSingle(BitwiseSelect(BitConverter.SingleToInt32Bits(op1), BitConverter.SingleToInt32Bits(op2), BitConverter.SingleToInt32Bits(op3)));
+        public static double BitwiseSelect(double op1, double op2, double op3) => BitConverter.Int64BitsToDouble(BitwiseSelect(BitConverter.DoubleToInt64Bits(op1), BitConverter.DoubleToInt64Bits(op2), BitConverter.DoubleToInt64Bits(op3)));
     }
 }
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/_TernaryOpTestTemplate.template b/src/coreclr/tests/src/JIT/HardwareIntrinsics/Arm/Shared/_TernaryOpTestTemplate.template
new file mode 100644 (file)
index 0000000..3c6b1aa
--- /dev/null
@@ -0,0 +1,564 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/******************************************************************************
+ * This file is auto-generated from a template file by the GenerateTests.csx  *
+ * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
+
+namespace JIT.HardwareIntrinsics.Arm
+{
+    public static partial class Program
+    {
+        private static void {TestName}()
+        {
+            var test = new {TemplateName}TernaryOpTest__{TestName}();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if ({LoadIsa}.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if ({LoadIsa}.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                if ({LoadIsa}.IsSupported)
+                {
+                    // Validates passing a static member works, using pinning and Load
+                    test.RunClsVarScenario_Load();
+                }
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if ({LoadIsa}.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+                }
+
+                // Validates passing the field of a local class works
+                test.RunClassLclFldScenario();
+
+                if ({LoadIsa}.IsSupported)
+                {
+                    // Validates passing the field of a local class works, using pinning and Load
+                    test.RunClassLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a class works
+                test.RunClassFldScenario();
+
+                if ({LoadIsa}.IsSupported)
+                {
+                    // Validates passing an instance member of a class works, using pinning and Load
+                    test.RunClassFldScenario_Load();
+                }
+
+                // Validates passing the field of a local struct works
+                test.RunStructLclFldScenario();
+
+                if ({LoadIsa}.IsSupported)
+                {
+                    // Validates passing the field of a local struct works, using pinning and Load
+                    test.RunStructLclFldScenario_Load();
+                }
+
+                // Validates passing an instance member of a struct works
+                test.RunStructFldScenario();
+
+                if ({LoadIsa}.IsSupported)
+                {
+                    // Validates passing an instance member of a struct works, using pinning and Load
+                    test.RunStructFldScenario_Load();
+                }
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class {TemplateName}TernaryOpTest__{TestName}
+    {
+        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({Op1BaseType}[] inArray1, {Op2BaseType}[] inArray2, {Op3BaseType}[] inArray3, {RetBaseType}[] outArray, int alignment)
+            {
+                int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>();
+                int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>();
+                int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<{Op3BaseType}>();
+                int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>();
+                if ((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<byte>(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
+                Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<{Op3BaseType}, byte>(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 {Op1VectorType}<{Op1BaseType}> _fld1;
+            public {Op2VectorType}<{Op2BaseType}> _fld2;
+            public {Op3VectorType}<{Op3BaseType}> _fld3;
+
+            public static TestStruct Create()
+            {
+                var testStruct = new TestStruct();
+
+                for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>());
+                for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>());
+                for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp3}; }
+                Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op3VectorType}<{Op3BaseType}>, byte>(ref testStruct._fld3), ref Unsafe.As<{Op3BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op3VectorType}<{Op3BaseType}>>());
+
+                return testStruct;
+            }
+
+            public void RunStructFldScenario({TemplateName}TernaryOpTest__{TestName} testClass)
+            {
+                var result = {Isa}.{Method}(_fld1, _fld2, _fld3);
+
+                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+            }
+
+            public void RunStructFldScenario_Load({TemplateName}TernaryOpTest__{TestName} testClass)
+            {
+                fixed ({Op1VectorType}<{Op1BaseType}>* pFld1 = &_fld1)
+                fixed ({Op2VectorType}<{Op2BaseType}>* pFld2 = &_fld2)
+                fixed ({Op3VectorType}<{Op3BaseType}>* pFld3 = &_fld3)
+                {
+                    var result = {Isa}.{Method}(
+                        {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(pFld1)),
+                        {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(pFld2)),
+                        {LoadIsa}.Load{Op3VectorType}(({Op3BaseType}*)(pFld3))
+                    );
+
+                    Unsafe.Write(testClass._dataTable.outArrayPtr, result);
+                    testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
+                }
+            }
+        }
+
+        private static readonly int LargestVectorSize = {LargestVectorSize};
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType});
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>() / sizeof({Op2BaseType});
+        private static readonly int Op3ElementCount = Unsafe.SizeOf<{Op3VectorType}<{Op3BaseType}>>() / sizeof({Op3BaseType});
+        private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType});
+
+        private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount];
+        private static {Op2BaseType}[] _data2 = new {Op2BaseType}[Op2ElementCount];
+        private static {Op3BaseType}[] _data3 = new {Op3BaseType}[Op3ElementCount];
+
+        private static {Op1VectorType}<{Op1BaseType}> _clsVar1;
+        private static {Op2VectorType}<{Op2BaseType}> _clsVar2;
+        private static {Op3VectorType}<{Op3BaseType}> _clsVar3;
+
+        private {Op1VectorType}<{Op1BaseType}> _fld1;
+        private {Op2VectorType}<{Op2BaseType}> _fld2;
+        private {Op3VectorType}<{Op3BaseType}> _fld3;
+
+        private DataTable _dataTable;
+
+        static {TemplateName}TernaryOpTest__{TestName}()
+        {
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _clsVar1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref _clsVar2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp3}; }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op3VectorType}<{Op3BaseType}>, byte>(ref _clsVar3), ref Unsafe.As<{Op3BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op3VectorType}<{Op3BaseType}>>());
+        }
+
+        public {TemplateName}TernaryOpTest__{TestName}()
+        {
+            Succeeded = true;
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>());
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp3}; }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op3VectorType}<{Op3BaseType}>, byte>(ref _fld3), ref Unsafe.As<{Op3BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op3VectorType}<{Op3BaseType}>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; }
+            for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp3}; }
+            _dataTable = new DataTable(_data1, _data2, _data3, new {RetBaseType}[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => {Isa}.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
+
+            var result = {Isa}.{Method}(
+                Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr),
+                Unsafe.Read<{Op3VectorType}<{Op3BaseType}>>(_dataTable.inArray3Ptr)
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
+
+            var result = {Isa}.{Method}(
+                {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(_dataTable.inArray1Ptr)),
+                {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(_dataTable.inArray2Ptr)),
+                {LoadIsa}.Load{Op3VectorType}(({Op3BaseType}*)(_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 result = typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op2VectorType}<{Op2BaseType}>), typeof({Op3VectorType}<{Op3BaseType}>) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr),
+                                        Unsafe.Read<{Op3VectorType}<{Op3BaseType}>>(_dataTable.inArray3Ptr)
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, ({RetVectorType}<{RetBaseType}>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
+
+            var result = typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op2VectorType}<{Op2BaseType}>), typeof({Op3VectorType}<{Op3BaseType}>) })
+                                     .Invoke(null, new object[] {
+                                        {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(_dataTable.inArray1Ptr)),
+                                        {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(_dataTable.inArray2Ptr)),
+                                        {LoadIsa}.Load{Op3VectorType}(({Op3BaseType}*)(_dataTable.inArray3Ptr))
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, ({RetVectorType}<{RetBaseType}>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
+
+            var result = {Isa}.{Method}(
+                _clsVar1,
+                _clsVar2,
+                _clsVar3
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
+
+            fixed ({Op1VectorType}<{Op1BaseType}>* pClsVar1 = &_clsVar1)
+            fixed ({Op2VectorType}<{Op2BaseType}>* pClsVar2 = &_clsVar2)
+            fixed ({Op3VectorType}<{Op3BaseType}>* pClsVar3 = &_clsVar3)
+            {
+                var result = {Isa}.{Method}(
+                    {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(pClsVar1)),
+                    {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(pClsVar2)),
+                    {LoadIsa}.Load{Op3VectorType}(({Op3BaseType}*)(pClsVar3))
+                );
+
+                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<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr);
+            var op2 = Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr);
+            var op3 = Unsafe.Read<{Op3VectorType}<{Op3BaseType}>>(_dataTable.inArray3Ptr);
+            var result = {Isa}.{Method}(op1, op2, op3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
+
+            var op1 = {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(_dataTable.inArray1Ptr));
+            var op2 = {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(_dataTable.inArray2Ptr));
+            var op3 = {LoadIsa}.Load{Op3VectorType}(({Op3BaseType}*)(_dataTable.inArray3Ptr));
+            var result = {Isa}.{Method}(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 {TemplateName}TernaryOpTest__{TestName}();
+            var result = {Isa}.{Method}(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
+
+            var test = new {TemplateName}TernaryOpTest__{TestName}();
+
+            fixed ({Op1VectorType}<{Op1BaseType}>* pFld1 = &test._fld1)
+            fixed ({Op2VectorType}<{Op2BaseType}>* pFld2 = &test._fld2)
+            fixed ({Op3VectorType}<{Op3BaseType}>* pFld3 = &test._fld3)
+            {
+                var result = {Isa}.{Method}(
+                    {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(pFld1)),
+                    {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(pFld2)),
+                    {LoadIsa}.Load{Op3VectorType}(({Op3BaseType}*)(pFld3))
+                );
+
+                Unsafe.Write(_dataTable.outArrayPtr, result);
+                ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+            }
+        }
+
+        public void RunClassFldScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
+
+            var result = {Isa}.{Method}(_fld1, _fld2, _fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunClassFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
+
+            fixed ({Op1VectorType}<{Op1BaseType}>* pFld1 = &_fld1)
+            fixed ({Op2VectorType}<{Op2BaseType}>* pFld2 = &_fld2)
+            fixed ({Op3VectorType}<{Op3BaseType}>* pFld3 = &_fld3)
+            {
+                var result = {Isa}.{Method}(
+                    {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(pFld1)),
+                    {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(pFld2)),
+                    {LoadIsa}.Load{Op3VectorType}(({Op3BaseType}*)(pFld3))
+                );
+
+                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 = {Isa}.{Method}(test._fld1, test._fld2, test._fld3);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
+        }
+
+        public void RunStructLclFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
+
+            var test = TestStruct.Create();
+            var result = {Isa}.{Method}(
+                {LoadIsa}.Load{Op1VectorType}(({Op1BaseType}*)(&test._fld1)),
+                {LoadIsa}.Load{Op2VectorType}(({Op2BaseType}*)(&test._fld2)),
+                {LoadIsa}.Load{Op3VectorType}(({Op3BaseType}*)(&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);
+        }
+
+        public void RunStructFldScenario_Load()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
+
+            var test = TestStruct.Create();
+            test.RunStructFldScenario_Load(this);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
+
+            bool succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                succeeded = true;
+            }
+
+            if (!succeeded)
+            {
+                Succeeded = false;
+            }
+        }
+
+        private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {Op2VectorType}<{Op2BaseType}> op2, {Op3VectorType}<{Op3BaseType}> op3, void* result, [CallerMemberName] string method = "")
+        {
+            {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount];
+            {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount];
+            {Op3BaseType}[] inArray3 = new {Op3BaseType}[Op3ElementCount];
+            {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1);
+            Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), op2);
+            Unsafe.WriteUnaligned(ref Unsafe.As<{Op3BaseType}, byte>(ref inArray3[0]), op3);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "")
+        {
+            {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount];
+            {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount];
+            {Op3BaseType}[] inArray3 = new {Op3BaseType}[Op3ElementCount];
+            {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op3BaseType}, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<{Op3VectorType}<{Op3BaseType}>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>());
+
+            ValidateResult(inArray1, inArray2, inArray3, outArray, method);
+        }
+
+        private void ValidateResult({Op1BaseType}[] firstOp, {Op2BaseType}[] secondOp, {Op3BaseType}[] thirdOp, {RetBaseType}[] result, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            {TemplateValidationLogic}
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>, {Op3VectorType}<{Op3BaseType}>): {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;
+            }
+        }
+    }
+}