Adding tests for the new apis to convert between S.Numerics and S.R.Intrinsic vectors...
authorTanner Gooding <tagoo@outlook.com>
Wed, 13 Nov 2019 23:41:01 +0000 (15:41 -0800)
committerCarol Eidt <carol.eidt@microsoft.com>
Wed, 13 Nov 2019 23:41:01 +0000 (15:41 -0800)
* Updating Vector128.AsVector3 to have a functioning implementation

* Adding test template metadata covering the new methods for converting between S.Numerics and S.R.Intrinsics

* Regenerating the existing tests

* Generating the new Vector conversion tests

Commit migrated from https://github.com/dotnet/coreclr/commit/4b902f244e529b7596b1501eea6fdf27753b91ca

53 files changed:
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Shared/GenerateTests.csx
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Shared/VectorAsNumericsTest.template [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Shared/VectorAsNumericsVectorTest.template [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.Byte.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.Double.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.Int16.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.Int32.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.Int64.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.SByte.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.Single.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.UInt16.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.UInt32.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/As.UInt64.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Byte.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Double.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Int16.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Int32.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Int64.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.SByte.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Single.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.UInt16.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.UInt32.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.UInt64.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector2.Single.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector3.Single.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector4.Single.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/Program.Vector128_1.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/Vector128_1_r.csproj
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/Vector128_1_ro.csproj
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.Byte.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.Double.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.Int16.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.Int32.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.Int64.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.SByte.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.Single.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.UInt16.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.UInt32.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/As.UInt64.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Byte.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Double.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Int16.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Int32.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Int64.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.SByte.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Single.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.UInt16.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.UInt32.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.UInt64.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/Program.Vector256_1.cs
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj
src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_ro.csproj
src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs

index 28dca4f..13a54c5 100644 (file)
@@ -200,16 +200,31 @@ private static readonly (string templateFileName, Dictionary<string, string> tem
     ("VectorZeroTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "Zero", ["VectorType"] = "Vector128", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "16" }),
     ("VectorZeroTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "Zero", ["VectorType"] = "Vector128", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "16" }),
 
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Byte",   ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetByte()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Int16",  ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Int32",  ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Int64",  ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "SByte",  ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Byte",   ["LargestVectorSize"] = "16", ["NextValueOp"] = "(byte)TestLibrary.Generator.GetByte()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(double)TestLibrary.Generator.GetDouble()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Int16",  ["LargestVectorSize"] = "16", ["NextValueOp"] = "(short)TestLibrary.Generator.GetInt16()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Int32",  ["LargestVectorSize"] = "16", ["NextValueOp"] = "(int)TestLibrary.Generator.GetInt32()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Int64",  ["LargestVectorSize"] = "16", ["NextValueOp"] = "(long)TestLibrary.Generator.GetInt64()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "SByte",  ["LargestVectorSize"] = "16", ["NextValueOp"] = "(sbyte)TestLibrary.Generator.GetSByte()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(float)TestLibrary.Generator.GetSingle()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(ushort)TestLibrary.Generator.GetUInt16()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(uint)TestLibrary.Generator.GetUInt32()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "As", ["VectorType"] = "Vector128", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(ulong)TestLibrary.Generator.GetUInt64()" }),
+
+    ("VectorAsNumericsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector2", ["VectorType"] = "Vector128", ["BaseType"] = "Single", ["NumericsType"] = "Vector2", ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()" }),
+    ("VectorAsNumericsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector3", ["VectorType"] = "Vector128", ["BaseType"] = "Single", ["NumericsType"] = "Vector3", ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()" }),
+    ("VectorAsNumericsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector4", ["VectorType"] = "Vector128", ["BaseType"] = "Single", ["NumericsType"] = "Vector4", ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()" }),
+
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "Byte",   ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(byte)TestLibrary.Generator.GetByte()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "Double", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(double)TestLibrary.Generator.GetDouble()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "Int16",  ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(short)TestLibrary.Generator.GetInt16()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "Int32",  ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(int)TestLibrary.Generator.GetInt32()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "Int64",  ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(long)TestLibrary.Generator.GetInt64()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "SByte",  ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(sbyte)TestLibrary.Generator.GetSByte()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "Single", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(float)TestLibrary.Generator.GetSingle()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "UInt16", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(ushort)TestLibrary.Generator.GetUInt16()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "UInt32", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(uint)TestLibrary.Generator.GetUInt32()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128_1", ["Method"] = "AsVector", ["VectorType"] = "Vector128", ["BaseType"] = "UInt64", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "16", ["NextValueOp"] = "(ulong)TestLibrary.Generator.GetUInt64()" }),
 
     ("VectorGetAndWithElementTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector128", ["BaseType"] = "Byte",   ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetByte()",   ["Imm"] = "0",  ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }),
     ("VectorGetAndWithElementTest.template", new Dictionary<string, string> { ["Isa"] = "Vector128", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector128", ["BaseType"] = "Byte",   ["LargestVectorSize"] = "16", ["NextValueOp"] = "TestLibrary.Generator.GetByte()",   ["Imm"] = "7",  ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15]" }),
@@ -353,16 +368,27 @@ private static readonly (string templateFileName, Dictionary<string, string> tem
     ("VectorZeroTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "Zero", ["VectorType"] = "Vector256", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "32" }),
     ("VectorZeroTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "Zero", ["VectorType"] = "Vector256", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "32" }),
 
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Byte",   ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetByte()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Double", ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetDouble()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Int16",  ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetInt16()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Int32",  ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetInt32()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Int64",  ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetInt64()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "SByte",  ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetSByte()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Single", ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetSingle()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetUInt16()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetUInt32()" }),
-    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetUInt64()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Byte",   ["LargestVectorSize"] = "32", ["NextValueOp"] = "(byte)TestLibrary.Generator.GetByte()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Double", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(double)TestLibrary.Generator.GetDouble()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Int16",  ["LargestVectorSize"] = "32", ["NextValueOp"] = "(short)TestLibrary.Generator.GetInt16()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Int32",  ["LargestVectorSize"] = "32", ["NextValueOp"] = "(int)TestLibrary.Generator.GetInt32()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Int64",  ["LargestVectorSize"] = "32", ["NextValueOp"] = "(long)TestLibrary.Generator.GetInt64()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "SByte",  ["LargestVectorSize"] = "32", ["NextValueOp"] = "(sbyte)TestLibrary.Generator.GetSByte()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "Single", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(float)TestLibrary.Generator.GetSingle()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "UInt16", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(ushort)TestLibrary.Generator.GetUInt16()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "UInt32", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(uint)TestLibrary.Generator.GetUInt32()" }),
+    ("VectorAsTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "As", ["VectorType"] = "Vector256", ["BaseType"] = "UInt64", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(ulong)TestLibrary.Generator.GetUInt64()" }),
+
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "Byte",   ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(byte)TestLibrary.Generator.GetByte()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "Double", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(double)TestLibrary.Generator.GetDouble()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "Int16",  ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(short)TestLibrary.Generator.GetInt16()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "Int32",  ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(int)TestLibrary.Generator.GetInt32()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "Int64",  ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(long)TestLibrary.Generator.GetInt64()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "SByte",  ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(sbyte)TestLibrary.Generator.GetSByte()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "Single", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(float)TestLibrary.Generator.GetSingle()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "UInt16", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(ushort)TestLibrary.Generator.GetUInt16()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "UInt32", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(uint)TestLibrary.Generator.GetUInt32()" }),
+    ("VectorAsNumericsVectorTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256_1", ["Method"] = "AsVector", ["VectorType"] = "Vector256", ["BaseType"] = "UInt64", ["NumericsType"] = "Vector", ["LargestVectorSize"] = "32", ["NextValueOp"] = "(ulong)TestLibrary.Generator.GetUInt64()" }),
 
     ("VectorGetAndWithElementTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector256", ["BaseType"] = "Byte",   ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetByte()",   ["Imm"] = "0",  ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }),
     ("VectorGetAndWithElementTest.template", new Dictionary<string, string> { ["Isa"] = "Vector256", ["Method"] = "GetAndWithElement", ["VectorType"] = "Vector256", ["BaseType"] = "Byte",   ["LargestVectorSize"] = "32", ["NextValueOp"] = "TestLibrary.Generator.GetByte()",   ["Imm"] = "7",  ["ConsumeValues"] = "values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7], values[8], values[9], values[10], values[11], values[12], values[13], values[14], values[15], values[16], values[17], values[18], values[19], values[20], values[21], values[22], values[23], values[24], values[25], values[26], values[27], values[28], values[29], values[30], values[31]" }),
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Shared/VectorAsNumericsTest.template b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Shared/VectorAsNumericsTest.template
new file mode 100644 (file)
index 0000000..239b2c7
--- /dev/null
@@ -0,0 +1,148 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void {Method}{BaseType}()
+        {
+            var test = new VectorAs__{Method}{BaseType}();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__{Method}{BaseType}
+    {
+        private static readonly int LargestVectorSize = {LargestVectorSize};
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<{VectorType}<{BaseType}>>() / sizeof({BaseType});
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<{NumericsType}>() / sizeof({BaseType});
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            {VectorType}<{BaseType}> value;
+
+            value = {VectorType}.Create({NextValueOp});
+            {NumericsType} result = value.As{NumericsType}();
+            ValidateResult(result, value);
+
+            value = result.As{VectorType}();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            {VectorType}<{BaseType}> value;
+
+            value = {VectorType}.Create({NextValueOp});
+            object Result = typeof({VectorType})
+                                .GetMethod(nameof({VectorType}.As{NumericsType}))
+                                .Invoke(null, new object[] { value });
+            ValidateResult(({NumericsType})(Result), value);
+
+            value = ({VectorType}<{BaseType}>)typeof({VectorType})
+                                .GetMethod(nameof({VectorType}.As{VectorType}), new Type[] { typeof({NumericsType}) })
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, ({NumericsType})(Result));
+        }
+
+        private void ValidateResult({NumericsType} result, {VectorType}<{BaseType}> value, [CallerMemberName] string method = "")
+        {
+            {BaseType}[] resultElements = new {BaseType}[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<{BaseType}, byte>(ref resultElements[0]), result);
+
+            {BaseType}[] valueElements = new {BaseType}[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<{BaseType}, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult({VectorType}<{BaseType}> result, {NumericsType} value, [CallerMemberName] string method = "")
+        {
+            {BaseType}[] resultElements = new {BaseType}[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<{BaseType}, byte>(ref resultElements[0]), result);
+
+            {BaseType}[] valueElements = new {BaseType}[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<{BaseType}, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult({BaseType}[] resultElements, {BaseType}[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{VectorType}<{BaseType}>.{Method}: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Shared/VectorAsNumericsVectorTest.template b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Shared/VectorAsNumericsVectorTest.template
new file mode 100644 (file)
index 0000000..4cbd2bb
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void {Method}{BaseType}()
+        {
+            var test = new VectorAs__{Method}{BaseType}();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__{Method}{BaseType}
+    {
+        private static readonly int LargestVectorSize = {LargestVectorSize};
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<{VectorType}<{BaseType}>>() / sizeof({BaseType});
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<{NumericsType}<{BaseType}>>() / sizeof({BaseType});
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            {VectorType}<{BaseType}> value;
+
+            value = {VectorType}.Create({NextValueOp});
+            {NumericsType}<{BaseType}> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.As{VectorType}();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            {VectorType}<{BaseType}> value;
+
+            value = {VectorType}.Create({NextValueOp});
+            object Result = typeof({VectorType})
+                                .GetMethod(nameof({VectorType}.AsVector))
+                                .MakeGenericMethod(typeof({BaseType}))
+                                .Invoke(null, new object[] { value });
+            ValidateResult(({NumericsType}<{BaseType}>)(Result), value);
+
+            value = ({VectorType}<{BaseType}>)typeof({VectorType})
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof({VectorType}.As{VectorType}))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof({NumericsType}<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof({BaseType}))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, ({NumericsType}<{BaseType}>)(Result));
+        }
+
+        private void ValidateResult({NumericsType}<{BaseType}> result, {VectorType}<{BaseType}> value, [CallerMemberName] string method = "")
+        {
+            {BaseType}[] resultElements = new {BaseType}[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<{BaseType}, byte>(ref resultElements[0]), result);
+
+            {BaseType}[] valueElements = new {BaseType}[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<{BaseType}, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult({VectorType}<{BaseType}> result, {NumericsType}<{BaseType}> value, [CallerMemberName] string method = "")
+        {
+            {BaseType}[] resultElements = new {BaseType}[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<{BaseType}, byte>(ref resultElements[0]), result);
+
+            {BaseType}[] valueElements = new {BaseType}[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<{BaseType}, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult({BaseType}[] resultElements, {BaseType}[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"{VectorType}<{BaseType}>.{Method}: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
index e08c250..c78d132 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<Byte> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<Byte> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<byte> byteResult = value.As<Byte, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<double> doubleResult = value.As<Byte, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<short> shortResult = value.As<Byte, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<int> intResult = value.As<Byte, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<long> longResult = value.As<Byte, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<sbyte> sbyteResult = value.As<Byte, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<float> floatResult = value.As<Byte, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<ushort> ushortResult = value.As<Byte, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<uint> uintResult = value.As<Byte, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             Vector128<ulong> ulongResult = value.As<Byte, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<Byte> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetByte());
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(Byte))
index 9124824..2e176c4 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<Double> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<Double> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<byte> byteResult = value.As<Double, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<double> doubleResult = value.As<Double, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<short> shortResult = value.As<Double, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<int> intResult = value.As<Double, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<long> longResult = value.As<Double, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<sbyte> sbyteResult = value.As<Double, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<float> floatResult = value.As<Double, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<ushort> ushortResult = value.As<Double, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<uint> uintResult = value.As<Double, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             Vector128<ulong> ulongResult = value.As<Double, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<Double> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetDouble());
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(Double))
index 98ba477..254e228 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<Int16> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<Int16> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<byte> byteResult = value.As<Int16, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<double> doubleResult = value.As<Int16, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<short> shortResult = value.As<Int16, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<int> intResult = value.As<Int16, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<long> longResult = value.As<Int16, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<sbyte> sbyteResult = value.As<Int16, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<float> floatResult = value.As<Int16, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<ushort> ushortResult = value.As<Int16, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<uint> uintResult = value.As<Int16, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             Vector128<ulong> ulongResult = value.As<Int16, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<Int16> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt16());
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(Int16))
index bf35ffd..ee7f4a3 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<Int32> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<Int32> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<byte> byteResult = value.As<Int32, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<double> doubleResult = value.As<Int32, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<short> shortResult = value.As<Int32, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<int> intResult = value.As<Int32, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<long> longResult = value.As<Int32, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<sbyte> sbyteResult = value.As<Int32, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<float> floatResult = value.As<Int32, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<ushort> ushortResult = value.As<Int32, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<uint> uintResult = value.As<Int32, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             Vector128<ulong> ulongResult = value.As<Int32, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<Int32> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt32());
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(Int32))
index 1ec98ac..e3aaeca 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<Int64> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<Int64> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<byte> byteResult = value.As<Int64, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<double> doubleResult = value.As<Int64, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<short> shortResult = value.As<Int64, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<int> intResult = value.As<Int64, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<long> longResult = value.As<Int64, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<sbyte> sbyteResult = value.As<Int64, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<float> floatResult = value.As<Int64, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<ushort> ushortResult = value.As<Int64, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<uint> uintResult = value.As<Int64, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             Vector128<ulong> ulongResult = value.As<Int64, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<Int64> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetInt64());
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(Int64))
index a7ca785..6029c32 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<SByte> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<SByte> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<byte> byteResult = value.As<SByte, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<double> doubleResult = value.As<SByte, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<short> shortResult = value.As<SByte, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<int> intResult = value.As<SByte, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<long> longResult = value.As<SByte, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<sbyte> sbyteResult = value.As<SByte, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<float> floatResult = value.As<SByte, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<ushort> ushortResult = value.As<SByte, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<uint> uintResult = value.As<SByte, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector128<ulong> ulongResult = value.As<SByte, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<SByte> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSByte());
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(SByte))
index 990e4ec..58b3428 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<Single> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<Single> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<byte> byteResult = value.As<Single, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<double> doubleResult = value.As<Single, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<short> shortResult = value.As<Single, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<int> intResult = value.As<Single, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<long> longResult = value.As<Single, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<sbyte> sbyteResult = value.As<Single, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<float> floatResult = value.As<Single, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<ushort> ushortResult = value.As<Single, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<uint> uintResult = value.As<Single, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             Vector128<ulong> ulongResult = value.As<Single, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<Single> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(Single))
index 21f892e..b7d4d3d 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<UInt16> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<UInt16> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<byte> byteResult = value.As<UInt16, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<double> doubleResult = value.As<UInt16, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<short> shortResult = value.As<UInt16, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<int> intResult = value.As<UInt16, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<long> longResult = value.As<UInt16, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<sbyte> sbyteResult = value.As<UInt16, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<float> floatResult = value.As<UInt16, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<ushort> ushortResult = value.As<UInt16, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<uint> uintResult = value.As<UInt16, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector128<ulong> ulongResult = value.As<UInt16, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<UInt16> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(UInt16))
index 4a1c2f5..a85289b 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<UInt32> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<UInt32> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<byte> byteResult = value.As<UInt32, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<double> doubleResult = value.As<UInt32, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<short> shortResult = value.As<UInt32, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<int> intResult = value.As<UInt32, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<long> longResult = value.As<UInt32, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<sbyte> sbyteResult = value.As<UInt32, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<float> floatResult = value.As<UInt32, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<ushort> ushortResult = value.As<UInt32, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<uint> uintResult = value.As<UInt32, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector128<ulong> ulongResult = value.As<UInt32, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<UInt32> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(UInt32))
index 27321f9..3c81793 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector128<UInt64> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector128<UInt64> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<byte> byteResult = value.As<UInt64, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<double> doubleResult = value.As<UInt64, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<short> shortResult = value.As<UInt64, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<int> intResult = value.As<UInt64, int>();
             ValidateResult(intResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<long> longResult = value.As<UInt64, long>();
             ValidateResult(longResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<sbyte> sbyteResult = value.As<UInt64, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<float> floatResult = value.As<UInt64, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<ushort> ushortResult = value.As<UInt64, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<uint> uintResult = value.As<UInt64, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector128<ulong> ulongResult = value.As<UInt64, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector128<UInt64> value;
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object byteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsByte))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<byte>)(byteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object doubleResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsDouble))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<double>)(doubleResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object shortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt16))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<short>)(shortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object intResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt32))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<int>)(intResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object longResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsInt64))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<long>)(longResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object sbyteResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSByte))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<sbyte>)(sbyteResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object floatResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsSingle))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<float>)(floatResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object ushortResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt16))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<ushort>)(ushortResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object uintResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt32))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector128<uint>)(uintResult), value);
 
-            value = Vector128.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
             object ulongResult = typeof(Vector128)
                                     .GetMethod(nameof(Vector128.AsUInt64))
                                     .MakeGenericMethod(typeof(UInt64))
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Byte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Byte.cs
new file mode 100644 (file)
index 0000000..8b51c95
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorByte()
+        {
+            var test = new VectorAs__AsVectorByte();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorByte
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<Byte>>() / sizeof(Byte);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Byte>>() / sizeof(Byte);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<Byte> value;
+
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
+            Vector<Byte> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<Byte> value;
+
+            value = Vector128.Create((byte)TestLibrary.Generator.GetByte());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(Byte))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Byte>)(Result), value);
+
+            value = (Vector128<Byte>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Byte))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Byte>)(Result));
+        }
+
+        private void ValidateResult(Vector<Byte> result, Vector128<Byte> value, [CallerMemberName] string method = "")
+        {
+            Byte[] resultElements = new Byte[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref resultElements[0]), result);
+
+            Byte[] valueElements = new Byte[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<Byte> result, Vector<Byte> value, [CallerMemberName] string method = "")
+        {
+            Byte[] resultElements = new Byte[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref resultElements[0]), result);
+
+            Byte[] valueElements = new Byte[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Byte[] resultElements, Byte[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<Byte>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Double.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Double.cs
new file mode 100644 (file)
index 0000000..0db7a5f
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorDouble()
+        {
+            var test = new VectorAs__AsVectorDouble();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorDouble
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<Double>>() / sizeof(Double);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Double>>() / sizeof(Double);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<Double> value;
+
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
+            Vector<Double> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<Double> value;
+
+            value = Vector128.Create((double)TestLibrary.Generator.GetDouble());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(Double))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Double>)(Result), value);
+
+            value = (Vector128<Double>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Double))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Double>)(Result));
+        }
+
+        private void ValidateResult(Vector<Double> result, Vector128<Double> value, [CallerMemberName] string method = "")
+        {
+            Double[] resultElements = new Double[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref resultElements[0]), result);
+
+            Double[] valueElements = new Double[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<Double> result, Vector<Double> value, [CallerMemberName] string method = "")
+        {
+            Double[] resultElements = new Double[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref resultElements[0]), result);
+
+            Double[] valueElements = new Double[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Double[] resultElements, Double[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<Double>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Int16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Int16.cs
new file mode 100644 (file)
index 0000000..a064aa9
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorInt16()
+        {
+            var test = new VectorAs__AsVectorInt16();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorInt16
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<Int16>>() / sizeof(Int16);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Int16>>() / sizeof(Int16);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<Int16> value;
+
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
+            Vector<Int16> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<Int16> value;
+
+            value = Vector128.Create((short)TestLibrary.Generator.GetInt16());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(Int16))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Int16>)(Result), value);
+
+            value = (Vector128<Int16>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Int16))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Int16>)(Result));
+        }
+
+        private void ValidateResult(Vector<Int16> result, Vector128<Int16> value, [CallerMemberName] string method = "")
+        {
+            Int16[] resultElements = new Int16[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref resultElements[0]), result);
+
+            Int16[] valueElements = new Int16[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<Int16> result, Vector<Int16> value, [CallerMemberName] string method = "")
+        {
+            Int16[] resultElements = new Int16[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref resultElements[0]), result);
+
+            Int16[] valueElements = new Int16[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Int16[] resultElements, Int16[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<Int16>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Int32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Int32.cs
new file mode 100644 (file)
index 0000000..bedd3e4
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorInt32()
+        {
+            var test = new VectorAs__AsVectorInt32();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorInt32
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Int32>>() / sizeof(Int32);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<Int32> value;
+
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
+            Vector<Int32> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<Int32> value;
+
+            value = Vector128.Create((int)TestLibrary.Generator.GetInt32());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(Int32))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Int32>)(Result), value);
+
+            value = (Vector128<Int32>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Int32))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Int32>)(Result));
+        }
+
+        private void ValidateResult(Vector<Int32> result, Vector128<Int32> value, [CallerMemberName] string method = "")
+        {
+            Int32[] resultElements = new Int32[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref resultElements[0]), result);
+
+            Int32[] valueElements = new Int32[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<Int32> result, Vector<Int32> value, [CallerMemberName] string method = "")
+        {
+            Int32[] resultElements = new Int32[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref resultElements[0]), result);
+
+            Int32[] valueElements = new Int32[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Int32[] resultElements, Int32[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<Int32>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Int64.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Int64.cs
new file mode 100644 (file)
index 0000000..74b95a8
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorInt64()
+        {
+            var test = new VectorAs__AsVectorInt64();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorInt64
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<Int64>>() / sizeof(Int64);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Int64>>() / sizeof(Int64);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<Int64> value;
+
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
+            Vector<Int64> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<Int64> value;
+
+            value = Vector128.Create((long)TestLibrary.Generator.GetInt64());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(Int64))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Int64>)(Result), value);
+
+            value = (Vector128<Int64>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Int64))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Int64>)(Result));
+        }
+
+        private void ValidateResult(Vector<Int64> result, Vector128<Int64> value, [CallerMemberName] string method = "")
+        {
+            Int64[] resultElements = new Int64[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref resultElements[0]), result);
+
+            Int64[] valueElements = new Int64[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<Int64> result, Vector<Int64> value, [CallerMemberName] string method = "")
+        {
+            Int64[] resultElements = new Int64[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref resultElements[0]), result);
+
+            Int64[] valueElements = new Int64[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Int64[] resultElements, Int64[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<Int64>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.SByte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.SByte.cs
new file mode 100644 (file)
index 0000000..01276b8
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorSByte()
+        {
+            var test = new VectorAs__AsVectorSByte();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorSByte
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<SByte>>() / sizeof(SByte);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<SByte>>() / sizeof(SByte);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<SByte> value;
+
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
+            Vector<SByte> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<SByte> value;
+
+            value = Vector128.Create((sbyte)TestLibrary.Generator.GetSByte());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(SByte))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<SByte>)(Result), value);
+
+            value = (Vector128<SByte>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(SByte))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<SByte>)(Result));
+        }
+
+        private void ValidateResult(Vector<SByte> result, Vector128<SByte> value, [CallerMemberName] string method = "")
+        {
+            SByte[] resultElements = new SByte[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref resultElements[0]), result);
+
+            SByte[] valueElements = new SByte[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<SByte> result, Vector<SByte> value, [CallerMemberName] string method = "")
+        {
+            SByte[] resultElements = new SByte[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref resultElements[0]), result);
+
+            SByte[] valueElements = new SByte[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(SByte[] resultElements, SByte[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<SByte>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.Single.cs
new file mode 100644 (file)
index 0000000..03277bb
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorSingle()
+        {
+            var test = new VectorAs__AsVectorSingle();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorSingle
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Single>>() / sizeof(Single);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<Single> value;
+
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
+            Vector<Single> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<Single> value;
+
+            value = Vector128.Create((float)TestLibrary.Generator.GetSingle());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(Single))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Single>)(Result), value);
+
+            value = (Vector128<Single>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Single))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Single>)(Result));
+        }
+
+        private void ValidateResult(Vector<Single> result, Vector128<Single> value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<Single> result, Vector<Single> value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Single[] resultElements, Single[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<Single>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.UInt16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.UInt16.cs
new file mode 100644 (file)
index 0000000..0be39b1
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorUInt16()
+        {
+            var test = new VectorAs__AsVectorUInt16();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorUInt16
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<UInt16>>() / sizeof(UInt16);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<UInt16> value;
+
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
+            Vector<UInt16> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<UInt16> value;
+
+            value = Vector128.Create((ushort)TestLibrary.Generator.GetUInt16());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(UInt16))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<UInt16>)(Result), value);
+
+            value = (Vector128<UInt16>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(UInt16))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<UInt16>)(Result));
+        }
+
+        private void ValidateResult(Vector<UInt16> result, Vector128<UInt16> value, [CallerMemberName] string method = "")
+        {
+            UInt16[] resultElements = new UInt16[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref resultElements[0]), result);
+
+            UInt16[] valueElements = new UInt16[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<UInt16> result, Vector<UInt16> value, [CallerMemberName] string method = "")
+        {
+            UInt16[] resultElements = new UInt16[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref resultElements[0]), result);
+
+            UInt16[] valueElements = new UInt16[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(UInt16[] resultElements, UInt16[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<UInt16>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.UInt32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.UInt32.cs
new file mode 100644 (file)
index 0000000..49f5db5
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorUInt32()
+        {
+            var test = new VectorAs__AsVectorUInt32();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorUInt32
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<UInt32>>() / sizeof(UInt32);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<UInt32> value;
+
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
+            Vector<UInt32> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<UInt32> value;
+
+            value = Vector128.Create((uint)TestLibrary.Generator.GetUInt32());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(UInt32))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<UInt32>)(Result), value);
+
+            value = (Vector128<UInt32>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(UInt32))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<UInt32>)(Result));
+        }
+
+        private void ValidateResult(Vector<UInt32> result, Vector128<UInt32> value, [CallerMemberName] string method = "")
+        {
+            UInt32[] resultElements = new UInt32[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref resultElements[0]), result);
+
+            UInt32[] valueElements = new UInt32[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<UInt32> result, Vector<UInt32> value, [CallerMemberName] string method = "")
+        {
+            UInt32[] resultElements = new UInt32[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref resultElements[0]), result);
+
+            UInt32[] valueElements = new UInt32[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(UInt32[] resultElements, UInt32[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<UInt32>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.UInt64.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector.UInt64.cs
new file mode 100644 (file)
index 0000000..35a5620
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorUInt64()
+        {
+            var test = new VectorAs__AsVectorUInt64();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorUInt64
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<UInt64>>() / sizeof(UInt64);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<UInt64> value;
+
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
+            Vector<UInt64> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<UInt64> value;
+
+            value = Vector128.Create((ulong)TestLibrary.Generator.GetUInt64());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector))
+                                .MakeGenericMethod(typeof(UInt64))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<UInt64>)(Result), value);
+
+            value = (Vector128<UInt64>)typeof(Vector128)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector128.AsVector128))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(UInt64))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<UInt64>)(Result));
+        }
+
+        private void ValidateResult(Vector<UInt64> result, Vector128<UInt64> value, [CallerMemberName] string method = "")
+        {
+            UInt64[] resultElements = new UInt64[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref resultElements[0]), result);
+
+            UInt64[] valueElements = new UInt64[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<UInt64> result, Vector<UInt64> value, [CallerMemberName] string method = "")
+        {
+            UInt64[] resultElements = new UInt64[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref resultElements[0]), result);
+
+            UInt64[] valueElements = new UInt64[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(UInt64[] resultElements, UInt64[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<UInt64>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector2.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector2.Single.cs
new file mode 100644 (file)
index 0000000..6f54642
--- /dev/null
@@ -0,0 +1,148 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVector2Single()
+        {
+            var test = new VectorAs__AsVector2Single();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVector2Single
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector2>() / sizeof(Single);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<Single> value;
+
+            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            Vector2 result = value.AsVector2();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<Single> value;
+
+            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector2))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector2)(Result), value);
+
+            value = (Vector128<Single>)typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector128), new Type[] { typeof(Vector2) })
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector2)(Result));
+        }
+
+        private void ValidateResult(Vector2 result, Vector128<Single> value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<Single> result, Vector2 value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Single[] resultElements, Single[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<Single>.AsVector2: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector3.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector3.Single.cs
new file mode 100644 (file)
index 0000000..d3431cb
--- /dev/null
@@ -0,0 +1,148 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVector3Single()
+        {
+            var test = new VectorAs__AsVector3Single();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVector3Single
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector3>() / sizeof(Single);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<Single> value;
+
+            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            Vector3 result = value.AsVector3();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<Single> value;
+
+            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector3))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector3)(Result), value);
+
+            value = (Vector128<Single>)typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector128), new Type[] { typeof(Vector3) })
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector3)(Result));
+        }
+
+        private void ValidateResult(Vector3 result, Vector128<Single> value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<Single> result, Vector3 value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Single[] resultElements, Single[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<Single>.AsVector3: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector4.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector128_1/AsVector4.Single.cs
new file mode 100644 (file)
index 0000000..facc875
--- /dev/null
@@ -0,0 +1,148 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVector4Single()
+        {
+            var test = new VectorAs__AsVector4Single();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVector4Single
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector4>() / sizeof(Single);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector128<Single> value;
+
+            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            Vector4 result = value.AsVector4();
+            ValidateResult(result, value);
+
+            value = result.AsVector128();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector128<Single> value;
+
+            value = Vector128.Create(TestLibrary.Generator.GetSingle());
+            object Result = typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector4))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector4)(Result), value);
+
+            value = (Vector128<Single>)typeof(Vector128)
+                                .GetMethod(nameof(Vector128.AsVector128), new Type[] { typeof(Vector4) })
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector4)(Result));
+        }
+
+        private void ValidateResult(Vector4 result, Vector128<Single> value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector128<Single> result, Vector4 value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Single[] resultElements, Single[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector128<Single>.AsVector4: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
index 370d6dc..d20b224 100644 (file)
@@ -32,6 +32,19 @@ namespace JIT.HardwareIntrinsics.General
                 ["As.UInt16"] = AsUInt16,
                 ["As.UInt32"] = AsUInt32,
                 ["As.UInt64"] = AsUInt64,
+                ["AsVector2.Single"] = AsVector2Single,
+                ["AsVector3.Single"] = AsVector3Single,
+                ["AsVector4.Single"] = AsVector4Single,
+                ["AsVector.Byte"] = AsVectorByte,
+                ["AsVector.Double"] = AsVectorDouble,
+                ["AsVector.Int16"] = AsVectorInt16,
+                ["AsVector.Int32"] = AsVectorInt32,
+                ["AsVector.Int64"] = AsVectorInt64,
+                ["AsVector.SByte"] = AsVectorSByte,
+                ["AsVector.Single"] = AsVectorSingle,
+                ["AsVector.UInt16"] = AsVectorUInt16,
+                ["AsVector.UInt32"] = AsVectorUInt32,
+                ["AsVector.UInt64"] = AsVectorUInt64,
                 ["GetAndWithElement.Byte.0"] = GetAndWithElementByte0,
                 ["GetAndWithElement.Byte.7"] = GetAndWithElementByte7,
                 ["GetAndWithElement.Byte.15"] = GetAndWithElementByte15,
index ae12675..461789a 100644 (file)
     <Compile Include="As.UInt16.cs" />
     <Compile Include="As.UInt32.cs" />
     <Compile Include="As.UInt64.cs" />
+    <Compile Include="AsVector.Byte.cs" />
+    <Compile Include="AsVector.Double.cs" />
+    <Compile Include="AsVector.Int16.cs" />
+    <Compile Include="AsVector.Int32.cs" />
+    <Compile Include="AsVector.Int64.cs" />
+    <Compile Include="AsVector.SByte.cs" />
+    <Compile Include="AsVector.Single.cs" />
+    <Compile Include="AsVector.UInt16.cs" />
+    <Compile Include="AsVector.UInt32.cs" />
+    <Compile Include="AsVector.UInt64.cs" />
+    <Compile Include="AsVector2.Single.cs" />
+    <Compile Include="AsVector3.Single.cs" />
+    <Compile Include="AsVector4.Single.cs" />
     <Compile Include="GetAndWithElement.Byte.0.cs" />
     <Compile Include="GetAndWithElement.Byte.7.cs" />
     <Compile Include="GetAndWithElement.Byte.15.cs" />
index bd0242c..3a91a6f 100644 (file)
     <Compile Include="As.UInt16.cs" />
     <Compile Include="As.UInt32.cs" />
     <Compile Include="As.UInt64.cs" />
+    <Compile Include="AsVector.Byte.cs" />
+    <Compile Include="AsVector.Double.cs" />
+    <Compile Include="AsVector.Int16.cs" />
+    <Compile Include="AsVector.Int32.cs" />
+    <Compile Include="AsVector.Int64.cs" />
+    <Compile Include="AsVector.SByte.cs" />
+    <Compile Include="AsVector.Single.cs" />
+    <Compile Include="AsVector.UInt16.cs" />
+    <Compile Include="AsVector.UInt32.cs" />
+    <Compile Include="AsVector.UInt64.cs" />
+    <Compile Include="AsVector2.Single.cs" />
+    <Compile Include="AsVector3.Single.cs" />
+    <Compile Include="AsVector4.Single.cs" />
     <Compile Include="GetAndWithElement.Byte.0.cs" />
     <Compile Include="GetAndWithElement.Byte.7.cs" />
     <Compile Include="GetAndWithElement.Byte.15.cs" />
index 2015313..9191e1f 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<Byte> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<Byte> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<byte> byteResult = value.As<Byte, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<double> doubleResult = value.As<Byte, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<short> shortResult = value.As<Byte, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<int> intResult = value.As<Byte, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<long> longResult = value.As<Byte, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<sbyte> sbyteResult = value.As<Byte, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<float> floatResult = value.As<Byte, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<ushort> ushortResult = value.As<Byte, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<uint> uintResult = value.As<Byte, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             Vector256<ulong> ulongResult = value.As<Byte, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<Byte> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(Byte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetByte());
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(Byte))
index 69f4e01..542c1da 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<Double> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<Double> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<byte> byteResult = value.As<Double, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<double> doubleResult = value.As<Double, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<short> shortResult = value.As<Double, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<int> intResult = value.As<Double, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<long> longResult = value.As<Double, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<sbyte> sbyteResult = value.As<Double, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<float> floatResult = value.As<Double, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<ushort> ushortResult = value.As<Double, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<uint> uintResult = value.As<Double, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             Vector256<ulong> ulongResult = value.As<Double, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<Double> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(Double))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetDouble());
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(Double))
index 094971d..5e2688f 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<Int16> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<Int16> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<byte> byteResult = value.As<Int16, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<double> doubleResult = value.As<Int16, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<short> shortResult = value.As<Int16, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<int> intResult = value.As<Int16, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<long> longResult = value.As<Int16, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<sbyte> sbyteResult = value.As<Int16, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<float> floatResult = value.As<Int16, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<ushort> ushortResult = value.As<Int16, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<uint> uintResult = value.As<Int16, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             Vector256<ulong> ulongResult = value.As<Int16, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<Int16> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(Int16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt16());
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(Int16))
index 09c19be..13bfefc 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<Int32> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<Int32> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<byte> byteResult = value.As<Int32, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<double> doubleResult = value.As<Int32, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<short> shortResult = value.As<Int32, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<int> intResult = value.As<Int32, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<long> longResult = value.As<Int32, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<sbyte> sbyteResult = value.As<Int32, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<float> floatResult = value.As<Int32, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<ushort> ushortResult = value.As<Int32, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<uint> uintResult = value.As<Int32, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             Vector256<ulong> ulongResult = value.As<Int32, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<Int32> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(Int32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt32());
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(Int32))
index 0bea200..ba52cec 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<Int64> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<Int64> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<byte> byteResult = value.As<Int64, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<double> doubleResult = value.As<Int64, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<short> shortResult = value.As<Int64, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<int> intResult = value.As<Int64, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<long> longResult = value.As<Int64, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<sbyte> sbyteResult = value.As<Int64, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<float> floatResult = value.As<Int64, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<ushort> ushortResult = value.As<Int64, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<uint> uintResult = value.As<Int64, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             Vector256<ulong> ulongResult = value.As<Int64, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<Int64> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(Int64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetInt64());
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(Int64))
index 3bd14a0..a9d631e 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<SByte> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<SByte> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<byte> byteResult = value.As<SByte, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<double> doubleResult = value.As<SByte, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<short> shortResult = value.As<SByte, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<int> intResult = value.As<SByte, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<long> longResult = value.As<SByte, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<sbyte> sbyteResult = value.As<SByte, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<float> floatResult = value.As<SByte, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<ushort> ushortResult = value.As<SByte, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<uint> uintResult = value.As<SByte, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             Vector256<ulong> ulongResult = value.As<SByte, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<SByte> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(SByte))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSByte());
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(SByte))
index d921f57..8a1c71e 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<Single> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<Single> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<byte> byteResult = value.As<Single, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<double> doubleResult = value.As<Single, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<short> shortResult = value.As<Single, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<int> intResult = value.As<Single, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<long> longResult = value.As<Single, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<sbyte> sbyteResult = value.As<Single, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<float> floatResult = value.As<Single, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<ushort> ushortResult = value.As<Single, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<uint> uintResult = value.As<Single, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             Vector256<ulong> ulongResult = value.As<Single, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<Single> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(Single))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetSingle());
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(Single))
index 02af220..9025b61 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<UInt16> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<UInt16> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<byte> byteResult = value.As<UInt16, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<double> doubleResult = value.As<UInt16, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<short> shortResult = value.As<UInt16, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<int> intResult = value.As<UInt16, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<long> longResult = value.As<UInt16, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<sbyte> sbyteResult = value.As<UInt16, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<float> floatResult = value.As<UInt16, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<ushort> ushortResult = value.As<UInt16, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<uint> uintResult = value.As<UInt16, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             Vector256<ulong> ulongResult = value.As<UInt16, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<UInt16> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(UInt16))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt16());
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(UInt16))
index 8db55b5..85c0800 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<UInt32> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<UInt32> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<byte> byteResult = value.As<UInt32, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<double> doubleResult = value.As<UInt32, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<short> shortResult = value.As<UInt32, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<int> intResult = value.As<UInt32, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<long> longResult = value.As<UInt32, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<sbyte> sbyteResult = value.As<UInt32, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<float> floatResult = value.As<UInt32, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<ushort> ushortResult = value.As<UInt32, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<uint> uintResult = value.As<UInt32, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             Vector256<ulong> ulongResult = value.As<UInt32, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<UInt32> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(UInt32))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt32());
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(UInt32))
index 0808d05..e056156 100644 (file)
@@ -51,43 +51,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
             Vector256<UInt64> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<byte> byteResult = value.AsByte();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<double> doubleResult = value.AsDouble();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<short> shortResult = value.AsInt16();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<int> intResult = value.AsInt32();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<long> longResult = value.AsInt64();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<sbyte> sbyteResult = value.AsSByte();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<float> floatResult = value.AsSingle();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<ushort> ushortResult = value.AsUInt16();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<uint> uintResult = value.AsUInt32();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<ulong> ulongResult = value.AsUInt64();
             ValidateResult(ulongResult, value);
         }
@@ -97,43 +97,43 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunGenericScenario));
             Vector256<UInt64> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<byte> byteResult = value.As<UInt64, byte>();
             ValidateResult(byteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<double> doubleResult = value.As<UInt64, double>();
             ValidateResult(doubleResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<short> shortResult = value.As<UInt64, short>();
             ValidateResult(shortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<int> intResult = value.As<UInt64, int>();
             ValidateResult(intResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<long> longResult = value.As<UInt64, long>();
             ValidateResult(longResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<sbyte> sbyteResult = value.As<UInt64, sbyte>();
             ValidateResult(sbyteResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<float> floatResult = value.As<UInt64, float>();
             ValidateResult(floatResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<ushort> ushortResult = value.As<UInt64, ushort>();
             ValidateResult(ushortResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<uint> uintResult = value.As<UInt64, uint>();
             ValidateResult(uintResult, value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             Vector256<ulong> ulongResult = value.As<UInt64, ulong>();
             ValidateResult(ulongResult, value);
         }
@@ -143,70 +143,70 @@ namespace JIT.HardwareIntrinsics.General
             TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
             Vector256<UInt64> value;
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object byteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsByte))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<byte>)(byteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object doubleResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsDouble))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<double>)(doubleResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object shortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt16))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<short>)(shortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object intResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt32))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<int>)(intResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object longResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsInt64))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<long>)(longResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object sbyteResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSByte))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<sbyte>)(sbyteResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object floatResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsSingle))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<float>)(floatResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object ushortResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt16))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<ushort>)(ushortResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object uintResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt32))
                                     .MakeGenericMethod(typeof(UInt64))
                                     .Invoke(null, new object[] { value });
             ValidateResult((Vector256<uint>)(uintResult), value);
 
-            value = Vector256.Create(TestLibrary.Generator.GetUInt64());
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
             object ulongResult = typeof(Vector256)
                                     .GetMethod(nameof(Vector256.AsUInt64))
                                     .MakeGenericMethod(typeof(UInt64))
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Byte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Byte.cs
new file mode 100644 (file)
index 0000000..d768bd5
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorByte()
+        {
+            var test = new VectorAs__AsVectorByte();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorByte
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<Byte>>() / sizeof(Byte);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Byte>>() / sizeof(Byte);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<Byte> value;
+
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
+            Vector<Byte> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<Byte> value;
+
+            value = Vector256.Create((byte)TestLibrary.Generator.GetByte());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(Byte))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Byte>)(Result), value);
+
+            value = (Vector256<Byte>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Byte))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Byte>)(Result));
+        }
+
+        private void ValidateResult(Vector<Byte> result, Vector256<Byte> value, [CallerMemberName] string method = "")
+        {
+            Byte[] resultElements = new Byte[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref resultElements[0]), result);
+
+            Byte[] valueElements = new Byte[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<Byte> result, Vector<Byte> value, [CallerMemberName] string method = "")
+        {
+            Byte[] resultElements = new Byte[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref resultElements[0]), result);
+
+            Byte[] valueElements = new Byte[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Byte[] resultElements, Byte[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<Byte>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Double.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Double.cs
new file mode 100644 (file)
index 0000000..a421577
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorDouble()
+        {
+            var test = new VectorAs__AsVectorDouble();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorDouble
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<Double>>() / sizeof(Double);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Double>>() / sizeof(Double);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<Double> value;
+
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
+            Vector<Double> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<Double> value;
+
+            value = Vector256.Create((double)TestLibrary.Generator.GetDouble());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(Double))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Double>)(Result), value);
+
+            value = (Vector256<Double>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Double))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Double>)(Result));
+        }
+
+        private void ValidateResult(Vector<Double> result, Vector256<Double> value, [CallerMemberName] string method = "")
+        {
+            Double[] resultElements = new Double[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref resultElements[0]), result);
+
+            Double[] valueElements = new Double[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<Double> result, Vector<Double> value, [CallerMemberName] string method = "")
+        {
+            Double[] resultElements = new Double[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref resultElements[0]), result);
+
+            Double[] valueElements = new Double[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Double, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Double[] resultElements, Double[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<Double>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Int16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Int16.cs
new file mode 100644 (file)
index 0000000..8391d3f
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorInt16()
+        {
+            var test = new VectorAs__AsVectorInt16();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorInt16
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<Int16>>() / sizeof(Int16);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Int16>>() / sizeof(Int16);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<Int16> value;
+
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
+            Vector<Int16> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<Int16> value;
+
+            value = Vector256.Create((short)TestLibrary.Generator.GetInt16());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(Int16))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Int16>)(Result), value);
+
+            value = (Vector256<Int16>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Int16))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Int16>)(Result));
+        }
+
+        private void ValidateResult(Vector<Int16> result, Vector256<Int16> value, [CallerMemberName] string method = "")
+        {
+            Int16[] resultElements = new Int16[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref resultElements[0]), result);
+
+            Int16[] valueElements = new Int16[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<Int16> result, Vector<Int16> value, [CallerMemberName] string method = "")
+        {
+            Int16[] resultElements = new Int16[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref resultElements[0]), result);
+
+            Int16[] valueElements = new Int16[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Int16[] resultElements, Int16[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<Int16>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Int32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Int32.cs
new file mode 100644 (file)
index 0000000..5bb4a7c
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorInt32()
+        {
+            var test = new VectorAs__AsVectorInt32();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorInt32
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<Int32>>() / sizeof(Int32);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Int32>>() / sizeof(Int32);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<Int32> value;
+
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
+            Vector<Int32> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<Int32> value;
+
+            value = Vector256.Create((int)TestLibrary.Generator.GetInt32());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(Int32))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Int32>)(Result), value);
+
+            value = (Vector256<Int32>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Int32))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Int32>)(Result));
+        }
+
+        private void ValidateResult(Vector<Int32> result, Vector256<Int32> value, [CallerMemberName] string method = "")
+        {
+            Int32[] resultElements = new Int32[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref resultElements[0]), result);
+
+            Int32[] valueElements = new Int32[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<Int32> result, Vector<Int32> value, [CallerMemberName] string method = "")
+        {
+            Int32[] resultElements = new Int32[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref resultElements[0]), result);
+
+            Int32[] valueElements = new Int32[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Int32[] resultElements, Int32[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<Int32>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Int64.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Int64.cs
new file mode 100644 (file)
index 0000000..70a045d
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorInt64()
+        {
+            var test = new VectorAs__AsVectorInt64();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorInt64
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<Int64>>() / sizeof(Int64);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Int64>>() / sizeof(Int64);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<Int64> value;
+
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
+            Vector<Int64> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<Int64> value;
+
+            value = Vector256.Create((long)TestLibrary.Generator.GetInt64());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(Int64))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Int64>)(Result), value);
+
+            value = (Vector256<Int64>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Int64))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Int64>)(Result));
+        }
+
+        private void ValidateResult(Vector<Int64> result, Vector256<Int64> value, [CallerMemberName] string method = "")
+        {
+            Int64[] resultElements = new Int64[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref resultElements[0]), result);
+
+            Int64[] valueElements = new Int64[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<Int64> result, Vector<Int64> value, [CallerMemberName] string method = "")
+        {
+            Int64[] resultElements = new Int64[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref resultElements[0]), result);
+
+            Int64[] valueElements = new Int64[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Int64[] resultElements, Int64[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<Int64>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.SByte.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.SByte.cs
new file mode 100644 (file)
index 0000000..017a6b0
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorSByte()
+        {
+            var test = new VectorAs__AsVectorSByte();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorSByte
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<SByte>>() / sizeof(SByte);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<SByte>>() / sizeof(SByte);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<SByte> value;
+
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
+            Vector<SByte> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<SByte> value;
+
+            value = Vector256.Create((sbyte)TestLibrary.Generator.GetSByte());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(SByte))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<SByte>)(Result), value);
+
+            value = (Vector256<SByte>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(SByte))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<SByte>)(Result));
+        }
+
+        private void ValidateResult(Vector<SByte> result, Vector256<SByte> value, [CallerMemberName] string method = "")
+        {
+            SByte[] resultElements = new SByte[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref resultElements[0]), result);
+
+            SByte[] valueElements = new SByte[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<SByte> result, Vector<SByte> value, [CallerMemberName] string method = "")
+        {
+            SByte[] resultElements = new SByte[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref resultElements[0]), result);
+
+            SByte[] valueElements = new SByte[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(SByte[] resultElements, SByte[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<SByte>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Single.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.Single.cs
new file mode 100644 (file)
index 0000000..2874cfc
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorSingle()
+        {
+            var test = new VectorAs__AsVectorSingle();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorSingle
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<Single>>() / sizeof(Single);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<Single>>() / sizeof(Single);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<Single> value;
+
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
+            Vector<Single> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<Single> value;
+
+            value = Vector256.Create((float)TestLibrary.Generator.GetSingle());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(Single))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<Single>)(Result), value);
+
+            value = (Vector256<Single>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(Single))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<Single>)(Result));
+        }
+
+        private void ValidateResult(Vector<Single> result, Vector256<Single> value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<Single> result, Vector<Single> value, [CallerMemberName] string method = "")
+        {
+            Single[] resultElements = new Single[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref resultElements[0]), result);
+
+            Single[] valueElements = new Single[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Single[] resultElements, Single[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<Single>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.UInt16.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.UInt16.cs
new file mode 100644 (file)
index 0000000..ede41db
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorUInt16()
+        {
+            var test = new VectorAs__AsVectorUInt16();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorUInt16
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<UInt16>>() / sizeof(UInt16);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<UInt16>>() / sizeof(UInt16);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<UInt16> value;
+
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
+            Vector<UInt16> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<UInt16> value;
+
+            value = Vector256.Create((ushort)TestLibrary.Generator.GetUInt16());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(UInt16))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<UInt16>)(Result), value);
+
+            value = (Vector256<UInt16>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(UInt16))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<UInt16>)(Result));
+        }
+
+        private void ValidateResult(Vector<UInt16> result, Vector256<UInt16> value, [CallerMemberName] string method = "")
+        {
+            UInt16[] resultElements = new UInt16[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref resultElements[0]), result);
+
+            UInt16[] valueElements = new UInt16[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<UInt16> result, Vector<UInt16> value, [CallerMemberName] string method = "")
+        {
+            UInt16[] resultElements = new UInt16[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref resultElements[0]), result);
+
+            UInt16[] valueElements = new UInt16[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(UInt16[] resultElements, UInt16[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<UInt16>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.UInt32.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.UInt32.cs
new file mode 100644 (file)
index 0000000..4ba2624
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorUInt32()
+        {
+            var test = new VectorAs__AsVectorUInt32();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorUInt32
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<UInt32>>() / sizeof(UInt32);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<UInt32>>() / sizeof(UInt32);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<UInt32> value;
+
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
+            Vector<UInt32> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<UInt32> value;
+
+            value = Vector256.Create((uint)TestLibrary.Generator.GetUInt32());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(UInt32))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<UInt32>)(Result), value);
+
+            value = (Vector256<UInt32>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(UInt32))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<UInt32>)(Result));
+        }
+
+        private void ValidateResult(Vector<UInt32> result, Vector256<UInt32> value, [CallerMemberName] string method = "")
+        {
+            UInt32[] resultElements = new UInt32[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref resultElements[0]), result);
+
+            UInt32[] valueElements = new UInt32[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<UInt32> result, Vector<UInt32> value, [CallerMemberName] string method = "")
+        {
+            UInt32[] resultElements = new UInt32[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref resultElements[0]), result);
+
+            UInt32[] valueElements = new UInt32[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(UInt32[] resultElements, UInt32[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<UInt32>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
diff --git a/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.UInt64.cs b/src/coreclr/tests/src/JIT/HardwareIntrinsics/General/Vector256_1/AsVector.UInt64.cs
new file mode 100644 (file)
index 0000000..1342823
--- /dev/null
@@ -0,0 +1,162 @@
+// 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\General\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Linq;
+using System.Numerics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+
+namespace JIT.HardwareIntrinsics.General
+{
+    public static partial class Program
+    {
+        private static void AsVectorUInt64()
+        {
+            var test = new VectorAs__AsVectorUInt64();
+
+            // Validates basic functionality works
+            test.RunBasicScenario();
+
+            // Validates calling via reflection works
+            test.RunReflectionScenario();
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class VectorAs__AsVectorUInt64
+    {
+        private static readonly int LargestVectorSize = 32;
+
+        private static readonly int VectorElementCount = Unsafe.SizeOf<Vector256<UInt64>>() / sizeof(UInt64);
+
+        private static readonly int NumericsElementCount = Unsafe.SizeOf<Vector<UInt64>>() / sizeof(UInt64);
+
+        public bool Succeeded { get; set; } = true;
+
+        public void RunBasicScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario));
+            Vector256<UInt64> value;
+
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
+            Vector<UInt64> result = value.AsVector();
+            ValidateResult(result, value);
+
+            value = result.AsVector256();
+            ValidateResult(value, result);
+        }
+
+        public void RunReflectionScenario()
+        {
+            TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario));
+            Vector256<UInt64> value;
+
+            value = Vector256.Create((ulong)TestLibrary.Generator.GetUInt64());
+            object Result = typeof(Vector256)
+                                .GetMethod(nameof(Vector256.AsVector))
+                                .MakeGenericMethod(typeof(UInt64))
+                                .Invoke(null, new object[] { value });
+            ValidateResult((Vector<UInt64>)(Result), value);
+
+            value = (Vector256<UInt64>)typeof(Vector256)
+                                .GetMethods()
+                                .Where((methodInfo) => {
+                                    if (methodInfo.Name == nameof(Vector256.AsVector256))
+                                    {
+                                        var parameters = methodInfo.GetParameters();
+                                        return (parameters.Length == 1) &&
+                                               (parameters[0].ParameterType.IsGenericType) &&
+                                               (parameters[0].ParameterType.GetGenericTypeDefinition() == typeof(Vector<>));
+                                    }
+                                    return false;
+                                })
+                                .Single()
+                                .MakeGenericMethod(typeof(UInt64))
+                                .Invoke(null, new object[] { Result });
+            ValidateResult(value, (Vector<UInt64>)(Result));
+        }
+
+        private void ValidateResult(Vector<UInt64> result, Vector256<UInt64> value, [CallerMemberName] string method = "")
+        {
+            UInt64[] resultElements = new UInt64[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref resultElements[0]), result);
+
+            UInt64[] valueElements = new UInt64[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(Vector256<UInt64> result, Vector<UInt64> value, [CallerMemberName] string method = "")
+        {
+            UInt64[] resultElements = new UInt64[VectorElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref resultElements[0]), result);
+
+            UInt64[] valueElements = new UInt64[NumericsElementCount];
+            Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref valueElements[0]), value);
+
+            ValidateResult(resultElements, valueElements, method);
+        }
+
+        private void ValidateResult(UInt64[] resultElements, UInt64[] valueElements, [CallerMemberName] string method = "")
+        {
+            bool succeeded = true;
+
+            if (resultElements.Length <= valueElements.Length)
+            {
+                for (var i = 0; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                for (var i = 0; i < valueElements.Length; i++)
+                {
+                    if (resultElements[i] != valueElements[i])
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+
+                for (var i = valueElements.Length; i < resultElements.Length; i++)
+                {
+                    if (resultElements[i] != default)
+                    {
+                        succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!succeeded)
+            {
+                TestLibrary.TestFramework.LogInformation($"Vector256<UInt64>.AsVector: {method} failed:");
+                TestLibrary.TestFramework.LogInformation($"   value: ({string.Join(", ", valueElements)})");
+                TestLibrary.TestFramework.LogInformation($"  result: ({string.Join(", ", resultElements)})");
+                TestLibrary.TestFramework.LogInformation(string.Empty);
+
+                Succeeded = false;
+            }
+        }
+    }
+}
index 5d28a4f..7db1c54 100644 (file)
@@ -32,6 +32,16 @@ namespace JIT.HardwareIntrinsics.General
                 ["As.UInt16"] = AsUInt16,
                 ["As.UInt32"] = AsUInt32,
                 ["As.UInt64"] = AsUInt64,
+                ["AsVector.Byte"] = AsVectorByte,
+                ["AsVector.Double"] = AsVectorDouble,
+                ["AsVector.Int16"] = AsVectorInt16,
+                ["AsVector.Int32"] = AsVectorInt32,
+                ["AsVector.Int64"] = AsVectorInt64,
+                ["AsVector.SByte"] = AsVectorSByte,
+                ["AsVector.Single"] = AsVectorSingle,
+                ["AsVector.UInt16"] = AsVectorUInt16,
+                ["AsVector.UInt32"] = AsVectorUInt32,
+                ["AsVector.UInt64"] = AsVectorUInt64,
                 ["GetAndWithElement.Byte.0"] = GetAndWithElementByte0,
                 ["GetAndWithElement.Byte.7"] = GetAndWithElementByte7,
                 ["GetAndWithElement.Byte.15"] = GetAndWithElementByte15,
index f31ca37..d7e666d 100644 (file)
     <Compile Include="As.UInt16.cs" />
     <Compile Include="As.UInt32.cs" />
     <Compile Include="As.UInt64.cs" />
+    <Compile Include="AsVector.Byte.cs" />
+    <Compile Include="AsVector.Double.cs" />
+    <Compile Include="AsVector.Int16.cs" />
+    <Compile Include="AsVector.Int32.cs" />
+    <Compile Include="AsVector.Int64.cs" />
+    <Compile Include="AsVector.SByte.cs" />
+    <Compile Include="AsVector.Single.cs" />
+    <Compile Include="AsVector.UInt16.cs" />
+    <Compile Include="AsVector.UInt32.cs" />
+    <Compile Include="AsVector.UInt64.cs" />
     <Compile Include="GetAndWithElement.Byte.0.cs" />
     <Compile Include="GetAndWithElement.Byte.7.cs" />
     <Compile Include="GetAndWithElement.Byte.15.cs" />
index b30e3a9..d166ec9 100644 (file)
     <Compile Include="As.UInt16.cs" />
     <Compile Include="As.UInt32.cs" />
     <Compile Include="As.UInt64.cs" />
+    <Compile Include="AsVector.Byte.cs" />
+    <Compile Include="AsVector.Double.cs" />
+    <Compile Include="AsVector.Int16.cs" />
+    <Compile Include="AsVector.Int32.cs" />
+    <Compile Include="AsVector.Int64.cs" />
+    <Compile Include="AsVector.SByte.cs" />
+    <Compile Include="AsVector.Single.cs" />
+    <Compile Include="AsVector.UInt16.cs" />
+    <Compile Include="AsVector.UInt32.cs" />
+    <Compile Include="AsVector.UInt64.cs" />
     <Compile Include="GetAndWithElement.Byte.0.cs" />
     <Compile Include="GetAndWithElement.Byte.7.cs" />
     <Compile Include="GetAndWithElement.Byte.15.cs" />
index 85c1471..a3ca363 100644 (file)
@@ -223,7 +223,7 @@ namespace System.Runtime.Intrinsics
         /// <returns><paramref name="value" /> reinterpreted as a new <see cref="Vector3" />.</returns>
         public static Vector3 AsVector3(this Vector128<float> value)
         {
-            throw new PlatformNotSupportedException();
+            return Unsafe.As<Vector128<float>, Vector3>(ref value);
         }
 
         /// <summary>Reinterprets a <see cref="Vector128{Single}" /> as a new <see cref="Vector4" />.</summary>