Merge pull request #18504 from mikedn/comp-small
authorBruce Forstall <brucefo@microsoft.com>
Tue, 3 Jul 2018 22:53:28 +0000 (15:53 -0700)
committerGitHub <noreply@github.com>
Tue, 3 Jul 2018 22:53:28 +0000 (15:53 -0700)
Make Compiler and CodeGen objects smaller

181 files changed:
BuildToolsVersion.txt
ILAsmVersion.txt
build-test.cmd
dependencies.props
netci.groovy
src/.nuget/Microsoft.NETCore.ILAsm/runtime.FreeBSD.Microsoft.NETCore.ILAsm.props [new file with mode: 0644]
src/.nuget/Microsoft.NETCore.ILDAsm/runtime.FreeBSD.Microsoft.NETCore.ILDAsm.props [new file with mode: 0644]
src/.nuget/Microsoft.NETCore.Jit/runtime.FreeBSD.Microsoft.NETCore.Jit.props [new file with mode: 0644]
src/.nuget/Microsoft.NETCore.Native/Microsoft.NETCore.Native.props
src/.nuget/Microsoft.NETCore.Native/runtime.FreeBSD.Microsoft.NETCore.Native.props [new file with mode: 0644]
src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.FreeBSD.Microsoft.NETCore.Runtime.CoreCLR.props [new file with mode: 0644]
src/.nuget/Microsoft.NETCore.TestHost/runtime.FreeBSD.Microsoft.NETCore.TestHost.props [new file with mode: 0644]
src/.nuget/dir.props
src/System.Private.CoreLib/Resources/Strings.resx
src/System.Private.CoreLib/System.Private.CoreLib.csproj
src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.cs
src/System.Private.CoreLib/shared/System/Runtime/Remoting/ObjectHandle.cs [new file with mode: 0644]
src/System.Private.CoreLib/shared/System/Threading/EventWaitHandle.cs
src/System.Private.CoreLib/src/System/Activator.cs
src/System.Private.CoreLib/src/System/Diagnostics/Eventing/DotNETRuntimeEventSource.cs [new file with mode: 0644]
src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.cs
src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs [new file with mode: 0644]
src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeMetadataGenerator.cs
src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipePayloadDecoder.cs [new file with mode: 0644]
src/System.Private.CoreLib/src/System/Diagnostics/Eventing/XplatEventLogger.cs
src/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs
src/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs
src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs
src/ToolBox/superpmi/mcs/verbremovedup.cpp
src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
src/ToolBox/superpmi/superpmi-shared/methodcontext.h
src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp
src/ToolBox/superpmi/superpmi-shared/methodcontextreader.h
src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp
src/ToolBox/superpmi/superpmi/superpmi.cpp
src/coreclr/hosts/corerun/corerun.cpp
src/jit/alloc.cpp
src/jit/compiler.h
src/jit/disasm.cpp
src/jit/hwintrinsiccodegenxarch.cpp
src/jit/hwintrinsiclistxarch.h
src/jit/hwintrinsicxarch.cpp
src/jit/importer.cpp
src/jit/lowerxarch.cpp
src/jit/lsra.cpp
src/jit/lsra.h
src/jit/lsraarm64.cpp
src/jit/lsraxarch.cpp
src/jit/simd.cpp
src/pal/src/arch/amd64/context2.S
src/scripts/genRuntimeEventSources.py
src/vm/ClrEtwAll.man
src/vm/ecalllist.h
src/vm/eventpipe.cpp
src/vm/eventpipe.h
src/vm/eventpipebuffermanager.cpp
src/vm/eventpipebuffermanager.h
src/vm/eventpipeconfiguration.cpp
src/vm/eventpipeconfiguration.h
src/vm/eventpipesession.cpp
src/vm/eventpipesession.h
tests/CoreFX/TopN.CoreFX.x64.Windows.issues.json
tests/issues.targets
tests/setup-stress-dependencies.cmd
tests/src/Common/CoreFX/CoreFX.depproj
tests/src/Common/stress_dependencies/stress_dependencies.csproj
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.Byte.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.Byte.20.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.Byte.52.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.Int32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.Int32.22.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.Int32.6.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.Int64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.Int64.19.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.Int64.3.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.UInt16.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.UInt16.11.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.UInt16.27.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.UInt32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.UInt32.22.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.UInt32.6.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.UInt64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.UInt64.19.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Extract.UInt64.3.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Byte.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Byte.20.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Byte.52.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int16.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int16.11.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int16.27.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.22.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.6.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int64.19.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int64.3.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.SByte.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.SByte.20.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.SByte.52.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.UInt16.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.UInt16.11.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.UInt16.27.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.UInt32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.UInt32.22.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.UInt32.6.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.UInt64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.UInt64.19.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.UInt64.3.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_r.csproj [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_ro.csproj [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Avx/StaticCast.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Avx/StaticCast_r.csproj [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Avx/StaticCast_ro.csproj [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Avx2/InsertVector128.Byte.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx2/InsertVector128.Int16.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx2/InsertVector128.Int32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx2/InsertVector128.Int64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx2/InsertVector128.SByte.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx2/InsertVector128.UInt16.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx2/InsertVector128.UInt32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Avx2/InsertVector128.UInt64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractScalarTest.template
tests/src/JIT/HardwareIntrinsics/X86/Shared/GenerateTests.csx
tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertScalarTest.template
tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertVector128Test.template
tests/src/JIT/HardwareIntrinsics/X86/Sse2/Extract.UInt16.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse2/Extract.UInt16.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse2/Insert.Int16.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse2/Insert.Int16.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse2/Insert.UInt16.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse2/Insert.UInt16.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.Byte.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.Byte.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.Int32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.Int32.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.Int64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.Int64.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.Single.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.Single.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.UInt32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.UInt32.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.UInt64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Extract.UInt64.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Byte.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Byte.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Int32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Int32.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Int64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Int64.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.SByte.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.SByte.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.0.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.1.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.128.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.129.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.16.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.192.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.2.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.32.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.4.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.48.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.64.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.8.cs [new file with mode: 0644]
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.UInt32.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.UInt32.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.UInt64.1.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.UInt64.129.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Program.Sse41.cs
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_r.csproj
tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_ro.csproj
tests/src/tracing/common/RuntimeEventSource.cs [new file with mode: 0644]
tests/src/tracing/common/common.csproj
tests/src/tracing/runtimeeventsource/RuntimeEventSourceTest.cs [new file with mode: 0644]
tests/src/tracing/runtimeeventsource/runtimeeventsource.csproj [new file with mode: 0644]

index 9eb2284..94646d2 100644 (file)
@@ -1 +1 @@
-2.2.0-preview1-02929-01
+2.2.0-preview1-03002-01
index 278f662..e615ae6 100644 (file)
@@ -1 +1 @@
-3.0.0-preview1-26630-01
+3.0.0-preview1-26703-04
index 58c6d32..d125b5d 100644 (file)
@@ -358,6 +358,19 @@ REM ===
 REM === Create the test overlay
 REM ===
 REM =========================================================================================
+
+set RuntimeIdArg=
+if defined __RuntimeId (
+    set RuntimeIdArg=-RuntimeID="%__RuntimeId%"
+)
+
+set TargetsWindowsArg=
+if "%__TargetsWindows%"=="1" (
+    set TargetsWindowsArg=-TargetsWindows=true
+) else if "%__TargetsWindows%"=="0" (
+    set TargetsWindowsArg=-TargetsWindows=false
+)
+
 echo %__MsgPrefix%Creating test overlay...
 
 set __BuildLogRootName=Tests_Overlay_Managed
@@ -403,19 +416,6 @@ if defined __SkipManaged goto SkipBuildingWrappers
 
 echo %__MsgPrefix%Creating test wrappers...
 
-set RuntimeIdArg=
-set TargetsWindowsArg=
-
-if defined __RuntimeId (
-    set RuntimeIdArg=-RuntimeID="%__RuntimeId%"
-)
-
-if "%__TargetsWindows%"=="1" (
-    set TargetsWindowsArg=-TargetsWindows=true
-) else if "%__TargetsWindows%"=="0" (
-    set TargetsWindowsArg=-TargetsWindows=false
-)
-
 set __BuildLogRootName=Tests_XunitWrapper
 set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.log
 set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn
index 5765b89..d565871 100644 (file)
   <!-- Source of truth for dependency tooling: the commit hash of the dotnet/versions master branch as of the last auto-upgrade. -->
   <PropertyGroup>
     <CoreFxCurrentRef>70c44f38436f4ae4734e792e06cefba1e412f9fc</CoreFxCurrentRef>
-    <CoreClrCurrentRef>cd6280de229b29999697824b19a89a9f4a41236a</CoreClrCurrentRef>
-    <BuildToolsCurrentRef>70c44f38436f4ae4734e792e06cefba1e412f9fc</BuildToolsCurrentRef>
-    <PgoDataCurrentRef>cd6280de229b29999697824b19a89a9f4a41236a</PgoDataCurrentRef>
+    <CoreClrCurrentRef>d8a64e527e67cae4bb3c9d93379fd43aa317165b</CoreClrCurrentRef>
+    <BuildToolsCurrentRef>3b2844e866d3898d43d98aad0e3e57dd5675d259</BuildToolsCurrentRef>
+    <PgoDataCurrentRef>d8a64e527e67cae4bb3c9d93379fd43aa317165b</PgoDataCurrentRef>
   </PropertyGroup>
 
   <!-- Tests/infrastructure dependency versions. -->
   <PropertyGroup>
     <MicrosoftPrivateCoreFxNETCoreAppPackageVersion>4.6.0-preview1-26628-03</MicrosoftPrivateCoreFxNETCoreAppPackageVersion>
     <MicrosoftNETCorePlatformsPackageVersion>3.0.0-preview1-26628-03</MicrosoftNETCorePlatformsPackageVersion>
-    <PgoDataPackageVersion>99.99.99-master-20180630-0049</PgoDataPackageVersion>
-    <MicrosoftNETCoreRuntimeCoreCLRPackageVersion>3.0.0-preview1-26630-01</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
+    <PgoDataPackageVersion>99.99.99-master-20180703-0030</PgoDataPackageVersion>
+    <MicrosoftNETCoreRuntimeCoreCLRPackageVersion>3.0.0-preview1-26703-04</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
     <XunitPackageVersion>2.2.0-beta2-build3300</XunitPackageVersion>
     <XunitConsoleNetcorePackageVersion>2.2.0-preview1-02830-02</XunitConsoleNetcorePackageVersion>
     <XunitPerformanceApiPackageVersion>1.0.0-beta-build0015</XunitPerformanceApiPackageVersion>
@@ -51,7 +51,7 @@
   <!-- Package versions used as toolsets -->
   <PropertyGroup>
     <FeedTasksPackage>Microsoft.DotNet.Build.Tasks.Feed</FeedTasksPackage>
-    <FeedTasksPackageVersion>2.2.0-preview1-02929-01</FeedTasksPackageVersion>
+    <FeedTasksPackageVersion>2.2.0-preview1-03002-01</FeedTasksPackageVersion>
   </PropertyGroup>
 
   <!-- Publish symbol build task package -->
index 39aeff7..dba45dc 100755 (executable)
@@ -2863,8 +2863,12 @@ Constants.allScenarios.each { scenario ->
                     // Create the new job
                     def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folderName)) {}
 
-                    // Should we add corefx_innerloop to views?
-                    addToViews(newJob, isPR, architecture, os)
+                    // We don't want to include in view any job that is only used by a flow job (because we want the views to have only the
+                    // "top-level" jobs. Build only jobs are such jobs.
+                    if (!isBuildOnly)
+                    {
+                        addToViews(newJob, isPR, architecture, os)
+                    }
 
                     setJobMachineAffinity(architecture, os, true, false, false, newJob) // isBuildJob = true, isTestJob = false, isFlowJob = false
 
@@ -3403,6 +3407,8 @@ ${runScript} \\
 
 // Create a test job that will be used by a flow job.
 // Returns the newly created job.
+// Note that we don't add tests jobs to the various views, since they are always used by a flow job, which is in the views,
+// and we want the views to be the minimal set of "top-level" jobs that represent all work.
 def static CreateTestJob(def dslFactory, def project, def branch, def architecture, def os, def configuration, def scenario, def isPR, def inputCoreCLRBuildName, def inputTestsBuildName)
 {
     def windowsArmJob = ((os == "Windows_NT") && (architecture in Constants.armWindowsCrossArchitectureList))
@@ -3417,8 +3423,6 @@ def static CreateTestJob(def dslFactory, def project, def branch, def architectu
 
     setJobMachineAffinity(architecture, os, false, true, false, newJob) // isBuildJob = false, isTestJob = true, isFlowJob = false
 
-    addToViews(newJob, isPR, architecture, os)
-
     if (scenario == 'jitdiff') {
         def osGroup = getOSGroup(os)
         Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/dasm/**")
diff --git a/src/.nuget/Microsoft.NETCore.ILAsm/runtime.FreeBSD.Microsoft.NETCore.ILAsm.props b/src/.nuget/Microsoft.NETCore.ILAsm/runtime.FreeBSD.Microsoft.NETCore.ILAsm.props
new file mode 100644 (file)
index 0000000..a8019b2
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <NativeBinary Include="$(BinDir)ilasm" />
+  </ItemGroup>
+</Project>
diff --git a/src/.nuget/Microsoft.NETCore.ILDAsm/runtime.FreeBSD.Microsoft.NETCore.ILDAsm.props b/src/.nuget/Microsoft.NETCore.ILDAsm/runtime.FreeBSD.Microsoft.NETCore.ILDAsm.props
new file mode 100644 (file)
index 0000000..f7ab15b
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <NativeBinary Include="$(BinDir)ildasm" />
+  </ItemGroup>
+</Project>
diff --git a/src/.nuget/Microsoft.NETCore.Jit/runtime.FreeBSD.Microsoft.NETCore.Jit.props b/src/.nuget/Microsoft.NETCore.Jit/runtime.FreeBSD.Microsoft.NETCore.Jit.props
new file mode 100644 (file)
index 0000000..b92d11a
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <NativeBinary Include="$(BinDir)libclrjit.so" />
+  </ItemGroup>
+</Project>
index ff2f587..a46a1be 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <SupportedPackageOSGroups>Linux;OSX</SupportedPackageOSGroups>
+    <SupportedPackageOSGroups>Linux;OSX;FreeBSD</SupportedPackageOSGroups>
   </PropertyGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/src/.nuget/Microsoft.NETCore.Native/runtime.FreeBSD.Microsoft.NETCore.Native.props b/src/.nuget/Microsoft.NETCore.Native/runtime.FreeBSD.Microsoft.NETCore.Native.props
new file mode 100644 (file)
index 0000000..dea614a
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <NativeBinary Include="$(BinDir)System.Globalization.Native.a" />
+    <NativeBinary Include="$(BinDir)System.Globalization.Native.so" />
+  </ItemGroup>
+</Project>
diff --git a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.FreeBSD.Microsoft.NETCore.Runtime.CoreCLR.props b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.FreeBSD.Microsoft.NETCore.Runtime.CoreCLR.props
new file mode 100644 (file)
index 0000000..fcf0d78
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <NativeBinary Include="$(BinDir)libcoreclr.so" />
+    <NativeBinary Condition="'$(_PlatformDoesNotSupportEventTrace)' != 'true'" Include="$(BinDir)libcoreclrtraceptprovider.so" />
+    <NativeBinary Include="$(BinDir)libdbgshim.so" />
+    <NativeBinary Include="$(BinDir)libmscordaccore.so" />
+    <NativeBinary Include="$(BinDir)libmscordbi.so" />
+    <NativeBinary Include="$(BinDir)libsos.so" />
+    <NativeBinary Condition="'$(_PlatformDoesNotSupportSosPlugin)' != 'true'" Include="$(BinDir)libsosplugin.so" />
+    <NativeBinary Include="$(BinDir)System.Globalization.Native.so" />
+    <NativeBinary Include="$(BinDir)sosdocsunix.txt" />
+    <CrossGenBinary Include="$(BinDir)System.Private.CoreLib.dll" />
+    <ArchitectureSpecificLibFile Include="$(BinDir)SOS.NETCore.dll" />
+    <ArchitectureSpecificToolFile Include="$(BinDir)crossgen" />
+    <CrossArchitectureSpecificToolFile Condition="'$(HasCrossTargetComponents)' == 'true'" Include="$(BinDir)$(CrossTargetComponentFolder)\crossgen" />
+  </ItemGroup>
+</Project>
diff --git a/src/.nuget/Microsoft.NETCore.TestHost/runtime.FreeBSD.Microsoft.NETCore.TestHost.props b/src/.nuget/Microsoft.NETCore.TestHost/runtime.FreeBSD.Microsoft.NETCore.TestHost.props
new file mode 100644 (file)
index 0000000..ce004bd
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <NativeBinary Include="$(BinDir)corerun" />
+  </ItemGroup>
+</Project>
index 4163f14..03d0675 100644 (file)
@@ -23,7 +23,7 @@
 
     <RuntimeOS Condition="'$(RuntimeOS)' == ''">$(OSRid)</RuntimeOS>
 
-    <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Android;Linux</SupportedPackageOSGroups>
+    <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Android;Linux;FreeBSD</SupportedPackageOSGroups>
     <SupportedPackageOSGroups>;$(SupportedPackageOSGroups);</SupportedPackageOSGroups>
 
     <!-- Identify OS family based upon the RuntimeOS, which could be distro specific (e.g. osx.10.12) or
index cb3dc3f..deab332 100644 (file)
   <data name="ArgumentOutOfRange_Week_ISO" xml:space="preserve">
     <value>The week parameter must be in the range 1 through 53.</value>
   </data>
-</root>
\ No newline at end of file
+  <data name="Argument_BadPInvokeMethod" xml:space="preserve">
+    <value>PInvoke methods must be static and native and cannot be abstract.</value>
+  </data>
+  <data name="Argument_BadPInvokeOnInterface" xml:space="preserve">
+    <value>PInvoke methods cannot exist on interfaces.</value>
+  </data>
+  <data name="Argument_MethodRedefined" xml:space="preserve">
+    <value>Method has been already defined.</value>
+  </data>
+</root>
index 1d522cb..562da8f 100644 (file)
     <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventSource_CoreCLR.cs" />
     <Compile Condition="'$(FeatureXplatEventSource)' == 'true'" Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\XplatEventLogger.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\FrameworkEventSource.cs" />
+    <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\DotNETRuntimeEventSource.cs" />
+    <Compile Include="$(IntermediateOutputPath)..\eventing\DotNETRuntimeEventSource.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventPipe.cs" />
+    <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventPipeEventDispatcher.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventPipeEventProvider.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventPipeMetadataGenerator.cs" />
-    <Compile Include="$(IntermediateOutputPath)..\eventing\DotNETRuntimeEventSource.cs" />
+    <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\EventPipePayloadDecoder.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventHandleTable.cs" />
   </ItemGroup>
   <ItemGroup>
index 59a3074..19c48e8 100644 (file)
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Intrinsics\Vector256.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Intrinsics\Vector256DebugView.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Intrinsics\X86\Enums.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Remoting\ObjectHandle.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Serialization\IDeserializationCallback.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Serialization\IFormatterConverter.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Serialization\IObjectReference.cs" />
index e766532..1620267 100644 (file)
@@ -2025,7 +2025,7 @@ namespace System.Diagnostics.Tracing
         }
 
         // helper for writing to all EventListeners attached the current eventSource.  
-        private unsafe void WriteToAllListeners(int eventId, Guid* activityID, Guid* childActivityID, params object[] args)
+        internal unsafe void WriteToAllListeners(int eventId, Guid* activityID, Guid* childActivityID, params object[] args)
         {
             EventWrittenEventArgs eventCallbackArgs = new EventWrittenEventArgs(this);
             eventCallbackArgs.EventId = eventId;
@@ -3948,6 +3948,13 @@ namespace System.Diagnostics.Tracing
             }
 
             eventSource.SendCommand(this, EventProviderType.None, 0, 0, EventCommand.Update, true, level, matchAnyKeyword, arguments);
+
+#if FEATURE_PERFTRACING
+            if (eventSource.GetType() == typeof(RuntimeEventSource))
+            {
+                EventPipeEventDispatcher.Instance.SendCommand(this, EventCommand.Update, true, level, matchAnyKeyword);
+            }
+#endif // FEATURE_PERFTRACING
         }
         /// <summary>
         /// Disables all events coming from eventSource identified by 'eventSource'.  
@@ -3962,6 +3969,13 @@ namespace System.Diagnostics.Tracing
             }
 
             eventSource.SendCommand(this, EventProviderType.None, 0, 0, EventCommand.Update, false, EventLevel.LogAlways, EventKeywords.None, null);
+
+#if FEATURE_PERFTRACING
+            if (eventSource.GetType() == typeof(RuntimeEventSource))
+            {
+                EventPipeEventDispatcher.Instance.SendCommand(this, EventCommand.Update, false, EventLevel.LogAlways, EventKeywords.None);
+            }
+#endif // FEATURE_PERFTRACING
         }
 
         /// <summary>
@@ -4133,6 +4147,11 @@ namespace System.Diagnostics.Tracing
                     }
                 }
             }
+
+#if FEATURE_PERFTRACING
+            // Remove the listener from the EventPipe dispatcher.
+            EventPipeEventDispatcher.Instance.RemoveEventListener(listenerToRemove);
+#endif // FEATURE_PERFTRACING
         }
 
         /// <summary>
index 63e0e29..2115e96 100644 (file)
@@ -241,6 +241,10 @@ namespace System.Runtime.Intrinsics.X86
         /// </summary>
         public static byte Extract(Vector256<byte> value, byte index)
         {
+            if (!IsSupported)
+            {
+                throw new PlatformNotSupportedException();
+            }
             return Unsafe.Add<byte>(ref Unsafe.As<Vector256<byte>, byte>(ref value), index & 0x1F);
         }
 
@@ -251,6 +255,10 @@ namespace System.Runtime.Intrinsics.X86
         /// </summary>
         public static ushort Extract(Vector256<ushort> value, byte index)
         {
+            if (!IsSupported)
+            {
+                throw new PlatformNotSupportedException();
+            }
             return Unsafe.Add<ushort>(ref Unsafe.As<Vector256<ushort>, ushort>(ref value), index & 0xF);
         }
 
@@ -260,6 +268,10 @@ namespace System.Runtime.Intrinsics.X86
         /// </summary>
         public static int Extract(Vector256<int> value, byte index)
         {
+            if (!IsSupported)
+            {
+                throw new PlatformNotSupportedException();
+            }
             return Unsafe.Add<int>(ref Unsafe.As<Vector256<int>, int>(ref value), index & 0x7);
         }
 
@@ -269,6 +281,10 @@ namespace System.Runtime.Intrinsics.X86
         /// </summary>
         public static uint Extract(Vector256<uint> value, byte index)
         {
+            if (!IsSupported)
+            {
+                throw new PlatformNotSupportedException();
+            }
             return Unsafe.Add<uint>(ref Unsafe.As<Vector256<uint>, uint>(ref value), index & 0x7);
         }
 
@@ -278,7 +294,7 @@ namespace System.Runtime.Intrinsics.X86
         /// </summary>
         public static long Extract(Vector256<long> value, byte index)
         {
-            if (IntPtr.Size != 8)
+            if (!IsSupported || (IntPtr.Size != 8))
             {
                 throw new PlatformNotSupportedException();
             }
@@ -291,7 +307,7 @@ namespace System.Runtime.Intrinsics.X86
         /// </summary>
         public static ulong Extract(Vector256<ulong> value, byte index)
         {
-            if (IntPtr.Size != 8)
+            if (!IsSupported || (IntPtr.Size != 8))
             {
                 throw new PlatformNotSupportedException();
             }
@@ -523,6 +539,11 @@ namespace System.Runtime.Intrinsics.X86
         /// </summary>
         public static Vector256<long> Insert(Vector256<long> value, long data, byte index)
         {
+            if (IntPtr.Size != 8)
+            {
+                throw new PlatformNotSupportedException();
+            }
+
             unsafe
             {
                 index &= 0x3;
@@ -539,6 +560,11 @@ namespace System.Runtime.Intrinsics.X86
         /// </summary>
         public static Vector256<ulong> Insert(Vector256<ulong> value, ulong data, byte index)
         {
+            if (IntPtr.Size != 8)
+            {
+                throw new PlatformNotSupportedException();
+            }
+
             unsafe
             {
                 index &= 0x3;
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Remoting/ObjectHandle.cs b/src/System.Private.CoreLib/shared/System/Runtime/Remoting/ObjectHandle.cs
new file mode 100644 (file)
index 0000000..a47aaf9
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.
+
+namespace System.Runtime.Remoting
+{
+    public class ObjectHandle : MarshalByRefObject        
+    {
+        private object _wrappedObject;
+
+        private ObjectHandle()
+        {
+        }
+
+        public ObjectHandle(object o)
+        {
+            _wrappedObject = o;
+        }
+
+        public object Unwrap()
+        {
+            return _wrappedObject;
+        }
+    }
+}
index 2542d81..4cd733b 100644 (file)
@@ -10,9 +10,9 @@ namespace System.Threading
     public partial class EventWaitHandle : WaitHandle
     {
         public EventWaitHandle(bool initialState, EventResetMode mode) :
-                       this(initialState, mode, null, out _)
-               {
-               }
+            this(initialState, mode, null, out _)
+        {
+        }
 
         public EventWaitHandle(bool initialState, EventResetMode mode, string name) :
             this(initialState, mode, name, out _)
index 05b8f37..eb0e6d6 100644 (file)
@@ -4,6 +4,8 @@
 
 using System.Reflection;
 using System.Globalization;
+using System.Runtime.Remoting;
+using System.Threading;
 
 namespace System
 {
@@ -62,6 +64,160 @@ namespace System
             throw new ArgumentException(SR.Arg_MustBeType, nameof(type));
         }
 
+        [System.Security.DynamicSecurityMethod]
+        public static ObjectHandle CreateInstance(string assemblyName, string typeName)
+        {
+            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
+            return CreateInstanceInternal(assemblyName,
+                                          typeName,
+                                          false,
+                                          Activator.ConstructorDefault,
+                                          null,
+                                          null,
+                                          null,
+                                          null,
+                                          ref stackMark);
+        }
+
+        [System.Security.DynamicSecurityMethod]
+        public static ObjectHandle CreateInstance(string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
+        {
+            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
+            return CreateInstanceInternal(assemblyName,
+                                          typeName,
+                                          ignoreCase,
+                                          bindingAttr,
+                                          binder,
+                                          args,
+                                          culture,
+                                          activationAttributes,
+                                          ref stackMark);
+        }
+
+        [System.Security.DynamicSecurityMethod]
+        public static ObjectHandle CreateInstance(string assemblyName, string typeName, object[] activationAttributes)
+        {
+            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
+            return CreateInstanceInternal(assemblyName,
+                                          typeName,
+                                          false,
+                                          Activator.ConstructorDefault,
+                                          null,
+                                          null,
+                                          null,
+                                          activationAttributes,
+                                          ref stackMark);
+        }
+
+        private static ObjectHandle CreateInstanceInternal(string assemblyString,
+                                                           string typeName,
+                                                           bool ignoreCase,
+                                                           BindingFlags bindingAttr,
+                                                           Binder binder,
+                                                           object[] args,
+                                                           CultureInfo culture,
+                                                           object[] activationAttributes,
+                                                           ref StackCrawlMark stackMark)
+        {
+            Type type = null;
+            Assembly assembly = null;
+            if (assemblyString == null)
+            {
+                assembly = RuntimeAssembly.GetExecutingAssembly(ref stackMark);
+            }
+            else
+            {
+                RuntimeAssembly assemblyFromResolveEvent;
+                AssemblyName assemblyName = RuntimeAssembly.CreateAssemblyName(assemblyString, out assemblyFromResolveEvent);
+                if (assemblyFromResolveEvent != null)
+                {
+                    // Assembly was resolved via AssemblyResolve event
+                    assembly = assemblyFromResolveEvent;
+                }
+                else if (assemblyName.ContentType == AssemblyContentType.WindowsRuntime)
+                {
+                    // WinRT type - we have to use Type.GetType
+                    type = Type.GetType(typeName + ", " + assemblyString, true /*throwOnError*/, ignoreCase);
+                }
+                else
+                {
+                    // Classic managed type
+                    assembly = RuntimeAssembly.InternalLoadAssemblyName(
+                        assemblyName, null, ref stackMark,
+                        true /*thrownOnFileNotFound*/);
+                }
+            }
+
+            if (type == null)
+            {
+                // It's classic managed type (not WinRT type)
+                if (assembly == null)
+                    return null;
+
+                type = assembly.GetType(typeName, true /*throwOnError*/, ignoreCase);
+            }
+
+            object o = Activator.CreateInstance(type,
+                                                bindingAttr,
+                                                binder,
+                                                args,
+                                                culture,
+                                                activationAttributes);
+
+            return (o != null) ? new ObjectHandle(o) : null;          
+        }
+
+        public static ObjectHandle CreateInstanceFrom(string assemblyFile, string typeName)
+        {
+            return CreateInstanceFrom(assemblyFile, typeName, null);
+        }
+
+        public static ObjectHandle CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
+        {
+            return CreateInstanceFromInternal(assemblyFile,
+                                              typeName,
+                                              ignoreCase,
+                                              bindingAttr,
+                                              binder,
+                                              args,
+                                              culture,
+                                              activationAttributes);
+        }
+
+        public static ObjectHandle CreateInstanceFrom(string assemblyFile, string typeName, object[] activationAttributes)
+        {
+            return CreateInstanceFrom(assemblyFile,
+                                      typeName,
+                                      false,
+                                      Activator.ConstructorDefault,
+                                      null,
+                                      null,
+                                      null,
+                                      activationAttributes);
+        }
+
+        private static ObjectHandle CreateInstanceFromInternal(string assemblyFile,
+                                                               string typeName,
+                                                               bool ignoreCase,
+                                                               BindingFlags bindingAttr,
+                                                               Binder binder,
+                                                               object[] args,
+                                                               CultureInfo culture,
+                                                               object[] activationAttributes)
+        {
+            Assembly assembly = Assembly.LoadFrom(assemblyFile);
+            Type t = assembly.GetType(typeName, true, ignoreCase);
+
+            object o = Activator.CreateInstance(t,
+                                                bindingAttr,
+                                                binder,
+                                                args,
+                                                culture,
+                                                activationAttributes);
+
+            return (o != null) ? new ObjectHandle(o) : null;
+        }
+
         public static T CreateInstance<T>()
         {
             var rt = (RuntimeType)typeof(T);
diff --git a/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/DotNETRuntimeEventSource.cs b/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/DotNETRuntimeEventSource.cs
new file mode 100644 (file)
index 0000000..8bfac2b
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+namespace System.Diagnostics.Tracing
+{
+#if FEATURE_PERFTRACING
+    /// <summary>
+    /// RuntimeEventSource is an EventSource that represents the ETW/EventPipe events emitted by the native runtime.
+    /// Most of RuntimeEventSource is auto-generated by scripts/genRuntimeEventSources.py based on the contents of the Microsoft-Windows-DotNETRuntime provider.
+    /// </summary>
+    internal sealed partial class RuntimeEventSource : EventSource
+    {
+        /// <summary>
+        /// Dispatch a single event with the specified event ID and payload.
+        /// </summary>
+        /// <param name="eventID">The eventID corresponding to the event as defined in the auto-generated portion of the RuntimeEventSource class.</param>
+        /// <param name="payload">A span pointing to the data payload for the event.</param>
+        [NonEvent]
+        internal unsafe void ProcessEvent(uint eventID, ReadOnlySpan<Byte> payload)
+        {
+            // Make sure the eventID is valid.
+            if (eventID >= m_eventData.Length)
+            {
+                return;
+            }
+
+            // Decode the payload.
+            object[] decodedPayloadFields = EventPipePayloadDecoder.DecodePayload(ref m_eventData[eventID], payload);
+            WriteToAllListeners((int)eventID, null, null, decodedPayloadFields);
+        }
+   }
+#endif // FEATURE_PERFTRACING
+}
index 58091be..89528cf 100644 (file)
@@ -7,9 +7,20 @@ using System.Runtime.InteropServices;
 using System.Security;
 using Microsoft.Win32;
 
+#if FEATURE_PERFTRACING
+
 namespace System.Diagnostics.Tracing
 {
     [StructLayout(LayoutKind.Sequential)]
+    internal struct EventPipeEventInstanceData
+    {
+        internal IntPtr ProviderID;
+        internal uint EventID;
+        internal IntPtr Payload;
+        internal uint PayloadLength;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
     internal struct EventPipeProviderConfiguration
     {
         [MarshalAs(UnmanagedType.LPWStr)]
@@ -166,6 +177,9 @@ namespace System.Diagnostics.Tracing
         internal static extern unsafe IntPtr DefineEvent(IntPtr provHandle, uint eventID, long keywords, uint eventVersion, uint level, void *pMetadata, uint metadataLength);
 
         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+        internal static extern IntPtr GetProvider(string providerName);
+
+        [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
         internal static extern void DeleteProvider(IntPtr provHandle);
 
         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
@@ -176,5 +190,10 @@ namespace System.Diagnostics.Tracing
 
         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
         internal static extern unsafe void WriteEventData(IntPtr eventHandle, uint eventID, EventProvider.EventData* pEventData, uint dataCount, Guid* activityId, Guid* relatedActivityId);
+
+        [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+        internal static extern unsafe bool GetNextEvent(EventPipeEventInstanceData* pInstance);
     }
 }
+
+#endif // FEATURE_PERFTRACING
diff --git a/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs b/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs
new file mode 100644 (file)
index 0000000..7d08d0d
--- /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.
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace System.Diagnostics.Tracing
+{
+#if FEATURE_PERFTRACING
+    internal sealed class EventPipeEventDispatcher
+    {
+        internal sealed class EventListenerSubscription
+        {
+            internal EventKeywords MatchAnyKeywords { get; private set; }
+            internal EventLevel Level { get; private set; }
+
+            internal EventListenerSubscription(EventKeywords matchAnyKeywords, EventLevel level)
+            {
+                MatchAnyKeywords = matchAnyKeywords;
+                Level = level;
+            }
+        }
+
+        internal static readonly EventPipeEventDispatcher Instance = new EventPipeEventDispatcher();
+
+        private IntPtr m_RuntimeProviderID;
+
+        private bool m_stopDispatchTask;
+        private Task m_dispatchTask = null;
+        private object m_dispatchControlLock = new object();
+        private Dictionary<EventListener, EventListenerSubscription> m_subscriptions = new Dictionary<EventListener, EventListenerSubscription>();
+
+        private EventPipeEventDispatcher()
+        {
+            // Get the ID of the runtime provider so that it can be used as a filter when processing events.
+            m_RuntimeProviderID = EventPipeInternal.GetProvider(RuntimeEventSource.EventSourceName);
+        }
+
+        internal void SendCommand(EventListener eventListener, EventCommand command, bool enable, EventLevel level, EventKeywords matchAnyKeywords)
+        {
+            if (command == EventCommand.Update && enable)
+            {
+                lock (m_dispatchControlLock)
+                {
+                    // Add the new subscription.  This will overwrite an existing subscription for the listener if one exists.
+                    m_subscriptions[eventListener] = new EventListenerSubscription(matchAnyKeywords, level);
+
+                    // Commit the configuration change.
+                    CommitDispatchConfiguration();
+                }
+            }
+            else if (command == EventCommand.Update && !enable)
+            {
+                RemoveEventListener(eventListener);
+            }
+        }
+
+        internal void RemoveEventListener(EventListener listener)
+        {
+            lock (m_dispatchControlLock)
+            {
+                // Remove the event listener from the list of subscribers.
+                if (m_subscriptions.ContainsKey(listener))
+                {
+                    m_subscriptions.Remove(listener);
+                }
+
+                // Commit the configuration change.
+                CommitDispatchConfiguration();
+            }
+        }
+
+        private void CommitDispatchConfiguration()
+        {
+            // Ensure that the dispatch task is stopped.
+            // This is a no-op if the task is already stopped.
+            StopDispatchTask();
+
+            // Stop tracing.
+            // This is a no-op if it's already disabled.
+            EventPipeInternal.Disable();
+
+            // Check to see if tracing should be enabled.
+            if (m_subscriptions.Count <= 0)
+            {
+                return;
+            }
+
+            // Start collecting events.
+            EventKeywords aggregatedKeywords = EventKeywords.None;
+            EventLevel highestLevel = EventLevel.LogAlways;
+
+            foreach (EventListenerSubscription subscription in m_subscriptions.Values)
+            {
+                aggregatedKeywords |= subscription.MatchAnyKeywords;
+                highestLevel = (subscription.Level > highestLevel) ? subscription.Level : highestLevel;
+            }
+
+            EventPipeProviderConfiguration[] providerConfiguration = new EventPipeProviderConfiguration[]
+            {
+                new EventPipeProviderConfiguration(RuntimeEventSource.EventSourceName, (ulong) aggregatedKeywords, (uint) highestLevel)
+            };
+
+            EventPipeInternal.Enable(null, 1024, 1, providerConfiguration, 1);
+
+            // Start the dispatch task.
+            StartDispatchTask();
+        }
+
+        private void StartDispatchTask()
+        {
+            Debug.Assert(Monitor.IsEntered(m_dispatchControlLock));
+
+            if (m_dispatchTask == null)
+            {
+                m_stopDispatchTask = false;
+                m_dispatchTask = Task.Factory.StartNew(DispatchEventsToEventListeners, TaskCreationOptions.LongRunning);
+            }
+        }
+
+        private void StopDispatchTask()
+        {
+            Debug.Assert(Monitor.IsEntered(m_dispatchControlLock));
+
+            if(m_dispatchTask != null)
+            {
+                m_stopDispatchTask = true;
+                m_dispatchTask.Wait();
+                m_dispatchTask = null;
+            }
+        }
+
+        private unsafe void DispatchEventsToEventListeners()
+        {
+            // Struct to fill with the call to GetNextEvent.
+            EventPipeEventInstanceData instanceData;
+
+            while (!m_stopDispatchTask)
+            {
+                // Get the next event.
+                while (!m_stopDispatchTask && EventPipeInternal.GetNextEvent(&instanceData))
+                {
+                    // Filter based on provider.
+                    if (instanceData.ProviderID == m_RuntimeProviderID)
+                    {
+                        // Dispatch the event.
+                        ReadOnlySpan<Byte> payload = new ReadOnlySpan<byte>((void*)instanceData.Payload, (int)instanceData.PayloadLength);
+                        RuntimeEventSource.Log.ProcessEvent(instanceData.EventID, payload);
+                    }
+                }
+
+                // Wait for more events.
+                if (!m_stopDispatchTask)
+                {
+                    Thread.Sleep(10);
+                }
+            }
+        }
+    }
+#endif // FEATURE_PERFTRACING
+}
index d18610d..a5cc756 100644 (file)
@@ -384,6 +384,13 @@ namespace System.Diagnostics.Tracing
             if (parameterType == typeof(Guid)) // Guid is not a part of TypeCode enum
                 return GuidTypeCode;
 
+            // IntPtr and UIntPtr are converted to their non-pointer types.
+            if (parameterType == typeof(IntPtr))
+                return IntPtr.Size == 4 ? TypeCode.Int32 : TypeCode.Int64;
+
+            if (parameterType == typeof(UIntPtr))
+                return UIntPtr.Size == 4 ? TypeCode.UInt32 : TypeCode.UInt64;
+
             return Type.GetTypeCode(parameterType);
         }
     }
diff --git a/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipePayloadDecoder.cs b/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipePayloadDecoder.cs
new file mode 100644 (file)
index 0000000..48aa580
--- /dev/null
@@ -0,0 +1,183 @@
+// 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.
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+namespace System.Diagnostics.Tracing
+{
+#if FEATURE_PERFTRACING
+    internal static class EventPipePayloadDecoder
+    {
+        /// <summary>
+        /// Given the metadata for an event and an event payload, decode and deserialize the event payload.
+        /// </summary>
+        internal static object[] DecodePayload(ref EventSource.EventMetadata metadata, ReadOnlySpan<Byte> payload)
+        {
+            ParameterInfo[] parameters = metadata.Parameters;
+            object[] decodedFields = new object[parameters.Length];
+            for (int i = 0; i < parameters.Length; i++)
+            {
+                // It is possible that an older version of the event was emitted.
+                // If this happens, the payload might be missing arguments at the end.
+                // We can just leave these unset.
+                if (payload.Length <= 0)
+                {
+                    break;
+                }
+
+                Type parameterType = parameters[i].ParameterType;
+                if (parameterType == typeof(IntPtr))
+                {
+                    if (IntPtr.Size == 8)
+                    {
+                        // Payload is automatically updated to point to the next piece of data.
+                        decodedFields[i] = (IntPtr)ReadUnalignedUInt64(ref payload);
+                    }
+                    else if (IntPtr.Size == 4)
+                    {
+                        decodedFields[i] = (IntPtr)MemoryMarshal.Read<Int32>(payload);
+                        payload = payload.Slice(IntPtr.Size);
+                    }
+                    else
+                    {
+                        Debug.Assert(false, "Unsupported pointer size.");
+                    }
+                }
+                else if (parameterType == typeof(int))
+                {
+                    decodedFields[i] = MemoryMarshal.Read<int>(payload);
+                    payload = payload.Slice(sizeof(int));
+                }
+                else if (parameterType == typeof(uint))
+                {
+                    decodedFields[i] = MemoryMarshal.Read<uint>(payload);
+                    payload = payload.Slice(sizeof(uint));
+                }
+                else if (parameterType == typeof(long))
+                {
+                    // Payload is automatically updated to point to the next piece of data.
+                    decodedFields[i] = (long)ReadUnalignedUInt64(ref payload);
+                }
+                else if (parameterType == typeof(ulong))
+                {
+                    // Payload is automatically updated to point to the next piece of data.
+                    decodedFields[i] = ReadUnalignedUInt64(ref payload);
+                }
+                else if (parameterType == typeof(byte))
+                {
+                    decodedFields[i] = MemoryMarshal.Read<byte>(payload);
+                    payload = payload.Slice(sizeof(byte));
+                }
+                else if (parameterType == typeof(sbyte))
+                {
+                    decodedFields[i] = MemoryMarshal.Read<sbyte>(payload);
+                    payload = payload.Slice(sizeof(sbyte));
+                }
+                else if (parameterType == typeof(short))
+                {
+                    decodedFields[i] = MemoryMarshal.Read<short>(payload);
+                    payload = payload.Slice(sizeof(short));
+                }
+                else if (parameterType == typeof(ushort))
+                {
+                    decodedFields[i] = MemoryMarshal.Read<ushort>(payload);
+                    payload = payload.Slice(sizeof(ushort));
+                }
+                else if (parameterType == typeof(float))
+                {
+                    decodedFields[i] = MemoryMarshal.Read<float>(payload);
+                    payload = payload.Slice(sizeof(float));
+                }
+                else if (parameterType == typeof(double))
+                {
+                    // Payload is automatically updated to point to the next piece of data.
+                    Int64 doubleBytes = (Int64)ReadUnalignedUInt64(ref payload);
+                    decodedFields[i] = BitConverter.Int64BitsToDouble(doubleBytes);
+                }
+                else if (parameterType == typeof(bool))
+                {
+                    // The manifest defines a bool as a 32bit type (WIN32 BOOL), not 1 bit as CLR Does.
+                    decodedFields[i] = (MemoryMarshal.Read<int>(payload) == 1);
+                    payload = payload.Slice(sizeof(int));
+                }
+                else if (parameterType == typeof(Guid))
+                {
+                    // Payload is automatically updated to point to the next piece of data.
+                    decodedFields[i] = ReadUnalignedGuid(ref payload);
+                }
+                else if (parameterType == typeof(char))
+                {
+                    decodedFields[i] = MemoryMarshal.Read<char>(payload);
+                    payload = payload.Slice(sizeof(char));
+                }
+                else if (parameterType == typeof(string))
+                {
+                    ReadOnlySpan<char> charPayload = MemoryMarshal.Cast<byte, char>(payload);
+                    int charCount = 0;
+                    foreach(char c in charPayload)
+                    {
+                        if (c == '\0')
+                            break;
+                        charCount++;
+                    }
+                    string val = new string(charPayload.ToArray(), 0, charCount);
+                    payload = payload.Slice((val.Length + 1) * sizeof(char));
+                    decodedFields[i] = val;
+                }
+                else
+                {
+                    Debug.Assert(false, "Unsupported type encountered.");
+                }
+            }
+
+            return decodedFields;
+        }
+
+        private static UInt64 ReadUnalignedUInt64(ref ReadOnlySpan<byte> payload)
+        {
+            UInt64 val = 0;
+            if (BitConverter.IsLittleEndian)
+            {
+                val |= MemoryMarshal.Read<UInt32>(payload);
+                payload = payload.Slice(sizeof(UInt32));
+                val |= (MemoryMarshal.Read<UInt32>(payload) << sizeof(UInt32));
+                payload = payload.Slice(sizeof(UInt32));
+            }
+            else
+            {
+                val |= (MemoryMarshal.Read<UInt32>(payload) << sizeof(UInt32));
+                payload = payload.Slice(sizeof(UInt32));
+                val |= MemoryMarshal.Read<UInt32>(payload);
+                payload = payload.Slice(sizeof(UInt32));
+            }
+
+            return val;
+        }
+
+        private static Guid ReadUnalignedGuid(ref ReadOnlySpan<byte> payload)
+        {
+            const int sizeOfGuid = 16;
+            byte[] guidBytes = new byte[sizeOfGuid];
+            if (BitConverter.IsLittleEndian)
+            {
+                for (int i = sizeOfGuid - 1; i >= 0; i--)
+                {
+                    guidBytes[i] = MemoryMarshal.Read<byte>(payload);
+                    payload = payload.Slice(sizeof(byte));
+                }
+            }
+            else
+            {
+                for (int i = 0; i < sizeOfGuid; i++)
+                {
+                    guidBytes[i] = MemoryMarshal.Read<byte>(payload);
+                    payload = payload.Slice(sizeof(byte));
+                }
+            }
+
+            return new Guid(guidBytes);
+        }
+    }
+#endif // FEATURE_PERFTRACING
+}
index 31cfb50..54238af 100644 (file)
@@ -156,6 +156,12 @@ namespace System.Diagnostics.Tracing
 
         internal protected  override void OnEventSourceCreated(EventSource eventSource)
         {
+            // Don't enable forwarding of RuntimeEventSource events.`
+            if (eventSource.GetType() == typeof(RuntimeEventSource))
+            {
+                return;
+            }
+
             string eventSourceFilter = eventSourceNameFilter.Value;
             if (string.IsNullOrEmpty(eventSourceFilter) || (eventSource.Name.IndexOf(eventSourceFilter, StringComparison.OrdinalIgnoreCase) >= 0))
             {   
index 5dd14ce..9c91c2f 100644 (file)
@@ -358,6 +358,11 @@ namespace System.Reflection.Emit
             }
         }
 
+        internal void SetToken(MethodToken token)
+        {
+            m_tkMethod = token;
+        }
+
         internal byte[] GetBody()
         {
             // Returns the il bytes of this method.
index 5bdd623..d0b8c87 100644 (file)
@@ -933,8 +933,35 @@ namespace System.Reflection.Emit
         #region Define Resource
 
         #endregion
-
         #region Define Global Method
+
+        public MethodBuilder DefinePInvokeMethod(string name, string dllName, MethodAttributes attributes,
+            CallingConventions callingConvention, Type returnType, Type[] parameterTypes,
+            CallingConvention nativeCallConv, CharSet nativeCharSet)
+        {
+            return DefinePInvokeMethod(name, dllName, name, attributes, callingConvention, returnType, parameterTypes, nativeCallConv, nativeCharSet);
+        }
+
+        public MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, MethodAttributes attributes,
+            CallingConventions callingConvention, Type returnType, Type[] parameterTypes, CallingConvention nativeCallConv,
+            CharSet nativeCharSet)
+        {
+            lock (SyncRoot)
+            {
+                //Global methods must be static.        
+                if ((attributes & MethodAttributes.Static) == 0)
+                {
+                    throw new ArgumentException(SR.Argument_GlobalFunctionHasToBeStatic);
+                }
+
+                CheckContext(returnType);
+                CheckContext(parameterTypes);
+
+                m_moduleData.m_fHasGlobal = true;
+                return m_moduleData.m_globalTypeBuilder.DefinePInvokeMethod(name, dllName, entryName, attributes, callingConvention, returnType, parameterTypes, nativeCallConv, nativeCharSet);
+            }
+        }
+
         public MethodBuilder DefineGlobalMethod(string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes)
         {
             return DefineGlobalMethod(name, attributes, CallingConventions.Standard, returnType, parameterTypes);
index 5f662fa..3097873 100644 (file)
@@ -227,6 +227,9 @@ namespace System.Reflection.Emit
         [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
         private static extern unsafe void SetConstantValue(RuntimeModule module, int tk, int corType, void* pValue);
 
+        [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+        private static extern void SetPInvokeData(RuntimeModule module, string DllName, string name, int token, int linkFlags);
+
         #endregion
         #region Internal\Private Static Members
 
@@ -580,7 +583,6 @@ namespace System.Reflection.Emit
 
         #endregion
         #region Private Members
-
         private FieldBuilder DefineDataHelper(string name, byte[] data, int size, FieldAttributes attributes)
         {
             string strValueClassName;
@@ -659,7 +661,6 @@ namespace System.Reflection.Emit
         {
             return m_hasBeenCreated;
         }
-
         #endregion
 
         #region FCalls
@@ -1401,6 +1402,141 @@ namespace System.Reflection.Emit
             return method;
         }
 
+        public MethodBuilder DefinePInvokeMethod(string name, string dllName, MethodAttributes attributes,
+            CallingConventions callingConvention, Type returnType, Type[] parameterTypes,
+            CallingConvention nativeCallConv, CharSet nativeCharSet)
+        {
+            MethodBuilder method = DefinePInvokeMethodHelper(
+                name, dllName, name, attributes, callingConvention, returnType, null, null,
+                parameterTypes, null, null, nativeCallConv, nativeCharSet);
+            return method;
+        }
+
+        public MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, MethodAttributes attributes,
+            CallingConventions callingConvention, Type returnType, Type[] parameterTypes,
+            CallingConvention nativeCallConv, CharSet nativeCharSet)
+        {
+            MethodBuilder method = DefinePInvokeMethodHelper(
+                name, dllName, entryName, attributes, callingConvention, returnType, null, null,
+                parameterTypes, null, null, nativeCallConv, nativeCharSet);
+            return method;
+        }
+
+        public MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, MethodAttributes attributes,
+            CallingConventions callingConvention,
+            Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers,
+            Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers,
+            CallingConvention nativeCallConv, CharSet nativeCharSet)
+        {
+            MethodBuilder method = DefinePInvokeMethodHelper(
+            name, dllName, entryName, attributes, callingConvention, returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers,
+            parameterTypes, parameterTypeRequiredCustomModifiers, parameterTypeOptionalCustomModifiers, nativeCallConv, nativeCharSet);
+            return method;
+        }
+
+        private MethodBuilder DefinePInvokeMethodHelper(
+            string name, string dllName, string importName, MethodAttributes attributes, CallingConventions callingConvention,
+            Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers,
+            Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers,
+            CallingConvention nativeCallConv, CharSet nativeCharSet)
+        {
+            CheckContext(returnType);
+            CheckContext(returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes);
+            CheckContext(parameterTypeRequiredCustomModifiers);
+            CheckContext(parameterTypeOptionalCustomModifiers);
+
+            lock (SyncRoot)
+            {
+                if (name == null)
+                    throw new ArgumentNullException(nameof(name));
+
+                if (name.Length == 0)
+                    throw new ArgumentException(SR.Argument_EmptyName, nameof(name));
+
+                if (dllName == null)
+                    throw new ArgumentNullException(nameof(dllName));
+
+                if (dllName.Length == 0)
+                    throw new ArgumentException(SR.Argument_EmptyName, nameof(dllName));
+
+                if (importName == null)
+                    throw new ArgumentNullException(nameof(importName));
+
+                if (importName.Length == 0)
+                    throw new ArgumentException(SR.Argument_EmptyName, nameof(importName));
+
+                if ((attributes & MethodAttributes.Abstract) != 0)
+                    throw new ArgumentException(SR.Argument_BadPInvokeMethod);
+
+                if ((m_iAttr & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface)
+                    throw new ArgumentException(SR.Argument_BadPInvokeOnInterface);
+
+                ThrowIfCreated();
+
+                attributes = attributes | MethodAttributes.PinvokeImpl;
+                MethodBuilder method = new MethodBuilder(name, attributes, callingConvention,
+                    returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers,
+                    parameterTypes, parameterTypeRequiredCustomModifiers, parameterTypeOptionalCustomModifiers,
+                    m_module, this, false);
+
+                //The signature grabbing code has to be up here or the signature won't be finished
+                //and our equals check won't work.
+                int sigLength;
+                byte[] sigBytes = method.GetMethodSignature().InternalGetSignature(out sigLength);
+
+                if (m_listMethods.Contains(method))
+                {
+                    throw new ArgumentException(SR.Argument_MethodRedefined);
+                }
+                m_listMethods.Add(method);
+
+                MethodToken token = method.GetToken();
+
+                int linkFlags = 0;
+                switch (nativeCallConv)
+                {
+                    case CallingConvention.Winapi:
+                        linkFlags = (int)PInvokeMap.CallConvWinapi;
+                        break;
+                    case CallingConvention.Cdecl:
+                        linkFlags = (int)PInvokeMap.CallConvCdecl;
+                        break;
+                    case CallingConvention.StdCall:
+                        linkFlags = (int)PInvokeMap.CallConvStdcall;
+                        break;
+                    case CallingConvention.ThisCall:
+                        linkFlags = (int)PInvokeMap.CallConvThiscall;
+                        break;
+                    case CallingConvention.FastCall:
+                        linkFlags = (int)PInvokeMap.CallConvFastcall;
+                        break;
+                }
+                switch (nativeCharSet)
+                {
+                    case CharSet.None:
+                        linkFlags |= (int)PInvokeMap.CharSetNotSpec;
+                        break;
+                    case CharSet.Ansi:
+                        linkFlags |= (int)PInvokeMap.CharSetAnsi;
+                        break;
+                    case CharSet.Unicode:
+                        linkFlags |= (int)PInvokeMap.CharSetUnicode;
+                        break;
+                    case CharSet.Auto:
+                        linkFlags |= (int)PInvokeMap.CharSetAuto;
+                        break;
+                }
+
+                SetPInvokeData(m_module.GetNativeHandle(),
+                    dllName,
+                    importName,
+                    token.Token,
+                    linkFlags);
+                method.SetToken(token);
+
+                return method;
+            }
+        }
         #endregion
 
         #region Define Constructor
index cd2ead0..64d5fa4 100644 (file)
@@ -11,8 +11,8 @@
 #include "methodcontextiterator.h"
 
 // We use a hash to limit the number of comparisons we need to do.
- //The first level key to our hash map is ILCodeSize and the second
- //level map key is just an index and the value is an existing MC Hash.
+// The first level key to our hash map is ILCodeSize and the second
+// level map key is just an index and the value is an existing MC Hash.
 
 LightWeightMap<int, DenseLightWeightMap<char*>*>* inFile = nullptr;
 
index b5de52f..97be26f 100644 (file)
@@ -2436,7 +2436,7 @@ InfoAccessType MethodContext::repConstructStringLiteral(CORINFO_MODULE_HANDLE mo
     return (InfoAccessType)temp2.B;
 }
 
-void MethodContext::recConvertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert, bool result)
+void MethodContext::recConvertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert, bool result)
 {
     if (ConvertPInvokeCalliToCall == nullptr)
         ConvertPInvokeCalliToCall = new LightWeightMap<DLD, DWORDLONG>();
@@ -2456,7 +2456,7 @@ void MethodContext::dmpConvertPInvokeCalliToCall(DLD key, DWORDLONG value)
 {
     printf("ConvertPInvokeCalliToCall key mod-%016llX tok-%08X, value %016llX", key.A, key.B, value);
 }
-bool MethodContext::repConvertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert)
+bool MethodContext::repConvertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert)
 {
     DLD key;
     ZeroMemory(&key, sizeof(DLD)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
@@ -4362,7 +4362,8 @@ void MethodContext::dmpCanInlineTypeCheckWithObjectVTable(DWORDLONG key, DWORD v
 }
 BOOL MethodContext::repCanInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls)
 {
-    AssertCodeMsg(CanInlineTypeCheckWithObjectVTable != nullptr, EXCEPTIONCODE_MC, "No map for CanInlineTypeCheckWithObjectVTable");
+    AssertCodeMsg(CanInlineTypeCheckWithObjectVTable != nullptr, EXCEPTIONCODE_MC,
+                  "No map for CanInlineTypeCheckWithObjectVTable");
     return (BOOL)CanInlineTypeCheckWithObjectVTable->Get((DWORDLONG)cls);
 }
 
index ac7acf1..739c1b2 100644 (file)
@@ -805,9 +805,9 @@ public:
     void dmpConstructStringLiteral(DLD key, DLD value);
     InfoAccessType repConstructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void** ppValue);
 
-    void recConvertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert, bool result);
+    void recConvertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert, bool result);
     void dmpConvertPInvokeCalliToCall(DLD key, DWORDLONG value);
-    bool repConvertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert);
+    bool repConvertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert);
 
     void recEmptyStringLiteral(void** ppValue, InfoAccessType result);
     void dmpEmptyStringLiteral(DWORD key, DLD value);
index beadcff..a978fa2 100644 (file)
@@ -83,26 +83,26 @@ MethodContextReader::MethodContextReader(
 {
     this->mutex = CreateMutexA(NULL, FALSE, nullptr);
 
-    std::string tocFileName, mchFile;
+    std::string tocFileName, mchFileName;
 
     // First, check to see if they passed an MCH file (look for a paired MCT file)
     tocFileName = MethodContextReader::CheckForPairedFile(inputFileName, ".mch", ".mct");
     if (!tocFileName.empty())
     {
-        mchFile = inputFileName;
+        mchFileName = inputFileName;
     }
     else
     {
         // Okay, it wasn't an MCH file, let's check to see if it was an MCT file
         // so check for a paired MCH file instead
-        mchFile = MethodContextReader::CheckForPairedFile(inputFileName, ".mct", ".mch");
-        if (!mchFile.empty())
+        mchFileName = MethodContextReader::CheckForPairedFile(inputFileName, ".mct", ".mch");
+        if (!mchFileName.empty())
         {
             tocFileName = inputFileName;
         }
         else
         {
-            mchFile = inputFileName;
+            mchFileName = inputFileName;
         }
     }
 
@@ -110,8 +110,8 @@ MethodContextReader::MethodContextReader(
         this->tocFile.LoadToc(tocFileName.c_str());
 
     // we'll get here even if we don't have a valid index file
-    this->fileHandle = OpenFile(mchFile.c_str(), (this->hasTOC() && this->hasIndex()) ? FILE_ATTRIBUTE_NORMAL
-                                                                                      : FILE_FLAG_SEQUENTIAL_SCAN);
+    this->fileHandle = OpenFile(mchFileName.c_str(), (this->hasTOC() && this->hasIndex()) ? FILE_ATTRIBUTE_NORMAL
+                                                                                          : FILE_FLAG_SEQUENTIAL_SCAN);
     if (this->fileHandle != INVALID_HANDLE_VALUE)
     {
         GetFileSizeEx(this->fileHandle, (PLARGE_INTEGER) & this->fileSize);
index e9ee451..ab1c693 100644 (file)
@@ -135,6 +135,13 @@ public:
     {
         return curMCIndex;
     }
+
+    // Return should this method context be excluded from the replay or not.
+    bool IsMethodExcluded(MethodContext* mc)
+    {
+        // Right now it is just a stub.
+        return false;
+    }
 };
 #pragma pack(pop)
 
index 5d70a54..32cc072 100644 (file)
@@ -1825,7 +1825,7 @@ InfoAccessType interceptor_ICJI::constructStringLiteral(CORINFO_MODULE_HANDLE mo
     return temp;
 }
 
-bool interceptor_ICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert)
+bool interceptor_ICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert)
 {
     mc->cr->AddCall("convertPInvokeCalliToCall");
     bool result = original_ICorJitInfo->convertPInvokeCalliToCall(pResolvedToken, fMustConvert);
index 316fd8c..8a3e80c 100644 (file)
@@ -1412,7 +1412,7 @@ InfoAccessType interceptor_ICJI::constructStringLiteral(CORINFO_MODULE_HANDLE mo
     return original_ICorJitInfo->constructStringLiteral(module, metaTok, ppValue);
 }
 
-bool interceptor_ICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert)
+bool interceptor_ICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert)
 {
     mcs->AddCall("convertPInvokeCalliToCall");
     return original_ICorJitInfo->convertPInvokeCalliToCall(pResolvedToken, fMustConvert);
index 97c4347..90b2fdb 100644 (file)
@@ -1266,7 +1266,7 @@ InfoAccessType interceptor_ICJI::constructStringLiteral(CORINFO_MODULE_HANDLE mo
     return original_ICorJitInfo->constructStringLiteral(module, metaTok, ppValue);
 }
 
-bool interceptor_ICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert)
+bool interceptor_ICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert)
 {
     return original_ICorJitInfo->convertPInvokeCalliToCall(pResolvedToken, fMustConvert);
 }
index 43ac5a8..31be088 100644 (file)
@@ -1580,7 +1580,7 @@ void* MyICJI::getTailCallCopyArgsThunk(CORINFO_SIG_INFO* pSig, CorInfoHelperTail
     return jitInstance->mc->repGetTailCallCopyArgsThunk(pSig, flags);
 }
 
-bool MyICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool fMustConvert)
+bool MyICJI::convertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fMustConvert)
 {
     jitInstance->mc->cr->AddCall("convertPInvokeCalliToCall");
     return jitInstance->mc->repConvertPInvokeCalliToCall(pResolvedToken, fMustConvert);
index 70afb5c..f58ec66 100644 (file)
@@ -195,6 +195,7 @@ void ProcessChildStdOut(const CommandLine::Options& o,
                         int*                        loaded,
                         int*                        jitted,
                         int*                        failed,
+                        int*                        excluded,
                         int*                        diffs,
                         bool*                       usageError)
 {
@@ -238,44 +239,42 @@ void ProcessChildStdOut(const CommandLine::Options& o,
         }
         else if (strncmp(buff, g_AllFormatStringFixedPrefix, strlen(g_AllFormatStringFixedPrefix)) == 0)
         {
+            int childLoaded = 0, childJitted = 0, childFailed = 0, childExcluded = 0;
             if (o.applyDiff)
             {
-                int temp1 = 0, temp2 = 0, temp3 = 0, temp4 = 0;
-                int converted = sscanf_s(buff, g_AsmDiffsSummaryFormatString, &temp1, &temp2, &temp3, &temp4);
-                if (converted != 4)
+                int childDiffs = 0;
+                int converted  = sscanf_s(buff, g_AsmDiffsSummaryFormatString, &childLoaded, &childJitted, &childFailed,
+                                         &childExcluded, &childDiffs);
+                if (converted != 5)
                 {
                     LogError("Couldn't parse status message: \"%s\"", buff);
+                    continue;
                 }
-                else
-                {
-                    *loaded += temp1;
-                    *jitted += temp2;
-                    *failed += temp3;
-                    *diffs += temp4;
-                }
+                *diffs += childDiffs;
             }
             else
             {
-                int temp1 = 0, temp2 = 0, temp3 = 0;
-                int converted = sscanf_s(buff, g_SummaryFormatString, &temp1, &temp2, &temp3);
-                if (converted != 3)
+                int converted =
+                    sscanf_s(buff, g_SummaryFormatString, &childLoaded, &childJitted, &childFailed, &childExcluded);
+                if (converted != 4)
                 {
                     LogError("Couldn't parse status message: \"%s\"", buff);
+                    continue;
                 }
-                else
-                {
-                    *loaded += temp1;
-                    *jitted += temp2;
-                    *failed += temp3;
-                    *diffs = -1;
-                }
+                *diffs = -1;
             }
+            *loaded += childLoaded;
+            *jitted += childJitted;
+            *failed += childFailed;
+            *excluded += childExcluded;
         }
     }
 
 Cleanup:
     if (fp != NULL)
+    {
         fclose(fp);
+    }
 }
 
 #ifndef FEATURE_PAL // TODO-Porting: handle Ctrl-C signals gracefully on Unix
@@ -604,14 +603,14 @@ int doParallelSuperPMI(CommandLine::Options& o)
 
         bool usageError = false; // variable to flag if we hit a usage error in SuperPMI
 
-        int loaded = 0, jitted = 0, failed = 0, diffs = 0;
+        int loaded = 0, jitted = 0, failed = 0, excluded = 0, diffs = 0;
 
         // Read the stderr files and log them as errors
         // Read the stdout files and parse them for counts and log any MISSING or ISSUE errors
         for (int i = 0; i < o.workerCount; i++)
         {
             ProcessChildStdErr(arrStdErrorPath[i]);
-            ProcessChildStdOut(o, arrStdOutputPath[i], &loaded, &jitted, &failed, &diffs, &usageError);
+            ProcessChildStdOut(o, arrStdOutputPath[i], &loaded, &jitted, &failed, &excluded, &diffs, &usageError);
             if (usageError)
                 break;
         }
index be5476e..5e80854 100644 (file)
@@ -26,8 +26,8 @@ extern int doParallelSuperPMI(CommandLine::Options& o);
 // There must be a single, fixed prefix common to all strings, to ease the determination of when
 // to parse the string fully.
 const char* const g_AllFormatStringFixedPrefix  = "Loaded ";
-const char* const g_SummaryFormatString         = "Loaded %d  Jitted %d  FailedCompile %d";
-const char* const g_AsmDiffsSummaryFormatString = "Loaded %d  Jitted %d  FailedCompile %d  Diffs %d";
+const char* const g_SummaryFormatString         = "Loaded %d  Jitted %d  FailedCompile %d Excluded %d";
+const char* const g_AsmDiffsSummaryFormatString = "Loaded %d  Jitted %d  FailedCompile %d Excluded %d Diffs %d";
 
 //#define SuperPMI_ChewMemory 0x7FFFFFFF //Amount of address space to consume on startup
 
@@ -238,6 +238,7 @@ int __cdecl main(int argc, char* argv[])
     int errorCount        = 0;
     int missingCount      = 0;
     int index             = 0;
+    int excludedCount     = 0;
 
     st1.Start();
     NearDiffer nearDiffer(o.targetArchitecture, o.useCoreDisTools);
@@ -284,7 +285,17 @@ int __cdecl main(int argc, char* argv[])
 
         loadedCount++;
         if (!MethodContext::Initialize(loadedCount, mcb.buff, mcb.size, &mc))
+        {
             return (int)SpmiResult::GeneralFailure;
+        }
+
+        if (reader->IsMethodExcluded(mc))
+        {
+            excludedCount++;
+            LogInfo("main method %d of size %d with was excluded from the compilation.",
+                    reader->GetMethodContextIndex(), mc->methodSize);
+            continue;
+        }
 
         if (jit == nullptr)
         {
@@ -552,12 +563,12 @@ int __cdecl main(int argc, char* argv[])
     // NOTE: these output status strings are parsed by parallelsuperpmi.cpp::ProcessChildStdOut().
     if (o.applyDiff)
     {
-        LogInfo(g_AsmDiffsSummaryFormatString, loadedCount, jittedCount, failToReplayCount,
+        LogInfo(g_AsmDiffsSummaryFormatString, loadedCount, jittedCount, failToReplayCount, excludedCount,
                 jittedCount - failToReplayCount - matchCount);
     }
     else
     {
-        LogInfo(g_SummaryFormatString, loadedCount, jittedCount, failToReplayCount);
+        LogInfo(g_SummaryFormatString, loadedCount, jittedCount, failToReplayCount, excludedCount);
     }
 
     st2.Stop();
index 47ec363..c1d1fce 100644 (file)
@@ -110,7 +110,7 @@ public:
 
             // Check for %CORE_ROOT% and try to load CoreCLR.dll from it if it is set
             StackSString coreRoot;
-                       m_coreCLRModule = NULL; // Initialize this here since we don't call TryLoadCoreCLR if CORE_ROOT is unset.
+            m_coreCLRModule = NULL; // Initialize this here since we don't call TryLoadCoreCLR if CORE_ROOT is unset.
             if (WszGetEnvironmentVariable(W("CORE_ROOT"), coreRoot) > 0 && coreRoot.GetCount() > 0)
             {
                 coreRoot.Append(W('\\'));
@@ -365,6 +365,64 @@ STARTUP_FLAGS CreateStartupFlags() {
     return initialFlags;
 }
 
+// Class used to manage activation context.
+// See: https://docs.microsoft.com/en-us/windows/desktop/SbsCs/using-the-activation-context-api
+class ActivationContext
+{
+public:
+    //       logger - Logger to record errors
+    // assemblyPath - Assembly containing activation context manifest
+    ActivationContext(Logger &logger, _In_z_ const WCHAR *assemblyPath)
+        : _actCookie{}
+        , _actCxt{ INVALID_HANDLE_VALUE }
+        , _logger{ logger }
+    {
+        ACTCTX cxt{};
+        cxt.cbSize = sizeof(cxt);
+        cxt.dwFlags = (ACTCTX_FLAG_APPLICATION_NAME_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID);
+        cxt.lpSource = assemblyPath;
+        cxt.lpResourceName = MAKEINTRESOURCEW(1); // The CreateProcess manifest which contains the context details
+
+        _actCxt = ::CreateActCtxW(&cxt);
+        if (_actCxt == INVALID_HANDLE_VALUE)
+        {
+            DWORD err = ::GetLastError();
+            if (err == ERROR_RESOURCE_TYPE_NOT_FOUND)
+            {
+                _logger << W("Assembly does not contain a manifest for activation") << Logger::endl;
+            }
+            else
+            {
+                _logger << W("Activation Context creation failed. Error Code: ") << Logger::hresult << err << Logger::endl;
+            }
+        }
+        else
+        {
+            BOOL res = ::ActivateActCtx(_actCxt, &_actCookie);
+            if (res == FALSE)
+                _logger << W("Failed to activate Activation Context. Error Code: ") << Logger::hresult << ::GetLastError() << Logger::endl;
+        }
+    }
+
+    ~ActivationContext()
+    {
+        if (_actCookie != ULONG_PTR{})
+        {
+            BOOL res = ::DeactivateActCtx(0, _actCookie);
+            if (res == FALSE)
+                _logger << W("Failed to de-activate Activation Context. Error Code: ") << Logger::hresult << ::GetLastError() << Logger::endl;
+        }
+
+        if (_actCxt != INVALID_HANDLE_VALUE)
+            ::ReleaseActCtx(_actCxt);
+    }
+
+private:
+    Logger &_logger;
+    HANDLE _actCxt;
+    ULONG_PTR _actCookie;
+};
+
 bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbose, const bool waitForDebugger, DWORD &exitCode)
 {
 
@@ -578,14 +636,18 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo
         }
     }
 
-    hr = host->ExecuteAssembly(domainId, managedAssemblyFullName, argc-1, (argc-1)?&(argv[1]):NULL, &exitCode);
-    if (FAILED(hr)) {
-        log << W("Failed call to ExecuteAssembly. ERRORCODE: ") << Logger::hresult << hr << Logger::endl;
-        return false;
-    }
+    {
+        ActivationContext cxt{ log, managedAssemblyFullName.GetUnicode() };
 
-    log << W("App exit value = ") << exitCode << Logger::endl;
+        hr = host->ExecuteAssembly(domainId, managedAssemblyFullName, argc - 1, (argc - 1) ? &(argv[1]) : NULL, &exitCode);
+        if (FAILED(hr))
+        {
+            log << W("Failed call to ExecuteAssembly. ERRORCODE: ") << Logger::hresult << hr << Logger::endl;
+            return false;
+        }
 
+        log << W("App exit value = ") << exitCode << Logger::endl;
+    }
 
     //-------------------------------------------------------------
 
index 8f1e0cc..d2c58e6 100644 (file)
@@ -110,7 +110,7 @@ public:
     }
 };
 
-ArenaAllocator::SinglePagePool ArenaAllocator::s_pagePool;
+ArenaAllocator::SinglePagePool ArenaAllocator::s_pagePool = {};
 
 //------------------------------------------------------------------------
 // ArenaAllocator::bypassHostAllocator:
@@ -200,7 +200,6 @@ void* ArenaAllocator::allocateNewPage(size_t size)
     if (pageSize < size)
     {
         NOMEM();
-        return nullptr;
     }
 
     // If the current page is now full, update a few statistics
@@ -247,7 +246,6 @@ void* ArenaAllocator::allocateNewPage(size_t size)
         if (newPage == nullptr)
         {
             NOMEM();
-            return nullptr;
         }
 
         if (tryPoolNewPage)
index ad9a00a..ec1e2ac 100644 (file)
@@ -7451,7 +7451,7 @@ private:
 
     // Pops and returns GenTree node from importers type stack.
     // Normalizes TYP_STRUCT value in case of GT_CALL, GT_RET_EXPR and arg nodes.
-    GenTree* impSIMDPopStack(var_types type, bool expectAddr = false);
+    GenTree* impSIMDPopStack(var_types type, bool expectAddr = false, CORINFO_CLASS_HANDLE structType = nullptr);
 
     // Create a GT_SIMD tree for a Get property of SIMD vector with a fixed index.
     GenTreeSIMD* impSIMDGetFixed(var_types simdType, var_types baseType, unsigned simdSize, int index);
index e76d5b3..99b71ac 100644 (file)
@@ -864,7 +864,6 @@ AddrToMethodHandleMap* DisAssembler::GetAddrToMethodHandleMap()
 {
     if (disAddrToMethodHandleMap == nullptr)
     {
-        assert(disComp->getAllocator() != nullptr);
         disAddrToMethodHandleMap = new (disComp->getAllocator()) AddrToMethodHandleMap(disComp->getAllocator());
     }
     return disAddrToMethodHandleMap;
@@ -877,7 +876,6 @@ AddrToMethodHandleMap* DisAssembler::GetHelperAddrToMethodHandleMap()
 {
     if (disHelperAddrToMethodHandleMap == nullptr)
     {
-        assert(disComp->getAllocator() != nullptr);
         disHelperAddrToMethodHandleMap = new (disComp->getAllocator()) AddrToMethodHandleMap(disComp->getAllocator());
     }
     return disHelperAddrToMethodHandleMap;
@@ -890,7 +888,6 @@ AddrToAddrMap* DisAssembler::GetRelocationMap()
 {
     if (disRelocationMap == nullptr)
     {
-        assert(disComp->getAllocator() != nullptr);
         disRelocationMap = new (disComp->getAllocator()) AddrToAddrMap(disComp->getAllocator());
     }
     return disRelocationMap;
index 97becaa..ce58f8b 100644 (file)
@@ -239,27 +239,10 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
                     {
                         ssize_t ival = op3->AsIntCon()->IconValue();
                         assert((ival >= 0) && (ival <= 255));
-
-                        if ((intrinsicId == NI_SSE41_Insert) && (baseType == TYP_FLOAT))
-                        {
-                            // Bits 6 and 7 impact the index that is selected from op2
-                            // when op2 is already in register. However, our API exposes
-                            // op2 as a scalar and so bits 6 and 7 must be set to 0.
-                            ival &= 0x3F;
-                        }
-
                         emitSwCase((int8_t)ival);
                     }
                     else
                     {
-                        if ((intrinsicId == NI_SSE41_Insert) && (baseType == TYP_FLOAT))
-                        {
-                            // Bits 6 and 7 impact the index that is selected from op2
-                            // when op2 is already in register. However, our API exposes
-                            // op2 as a scalar and so bits 6 and 7 must be set to 0.
-                            emit->emitIns_R_I(INS_and, EA_1BYTE, op3Reg, 0x3F);
-                        }
-
                         // We emit a fallback case for the scenario when the imm-op is not a constant. This should
                         // normally happen when the intrinsic is called indirectly, such as via Reflection. However, it
                         // can also occur if the consumer calls it directly and just doesn't pass a constant value.
@@ -1354,7 +1337,6 @@ void CodeGen::genSSEIntrinsic(GenTreeHWIntrinsic* node)
         }
 
         case NI_SSE_ConvertToSingle:
-        case NI_SSE_StaticCast:
         {
             assert(op2 == nullptr);
             if (op1Reg != targetReg)
@@ -2002,7 +1984,6 @@ void CodeGen::genAvxOrAvx2Intrinsic(GenTreeHWIntrinsic* node)
         }
 
         case NI_AVX_GetLowerHalf:
-        case NI_AVX_StaticCast:
         {
             assert(op2 == nullptr);
             regNumber op1Reg = op1->gtRegNum;
index 3f2f08b..84c5e87 100644 (file)
@@ -106,7 +106,7 @@ HARDWARE_INTRINSIC(SSE_SetZeroVector128,                            "SetZeroVect
 HARDWARE_INTRINSIC(SSE_Shuffle,                                     "Shuffle",                                      SSE,          -1,              16,           3,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_shufps,         INS_invalid},           HW_Category_IMM,                    HW_Flag_FullRangeIMM)
 HARDWARE_INTRINSIC(SSE_Sqrt,                                        "Sqrt",                                         SSE,          -1,              16,           1,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_sqrtps,         INS_invalid},           HW_Category_SimpleSIMD,             HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(SSE_SqrtScalar,                                  "SqrtScalar",                                   SSE,          -1,              16,          -1,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_sqrtss,         INS_invalid},           HW_Category_SIMDScalar,             HW_Flag_CopyUpperBits)
-HARDWARE_INTRINSIC(SSE_StaticCast,                                  "StaticCast",                                   SSE,          -1,              16,           1,     {INS_movaps,            INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps},            HW_Category_Helper,                 HW_Flag_NoContainment|HW_Flag_TwoTypeGeneric|HW_Flag_NoRMWSemantics)
+HARDWARE_INTRINSIC(SSE_StaticCast,                                  "StaticCast",                                   SSE,          -1,              16,           1,     {INS_movaps,            INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps,         INS_movaps},            HW_Category_Helper,                 HW_Flag_NoCodeGen|HW_Flag_TwoTypeGeneric)
 HARDWARE_INTRINSIC(SSE_Store,                                       "Store",                                        SSE,          -1,              16,           2,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_movups,         INS_invalid},           HW_Category_MemoryStore,            HW_Flag_NoContainment|HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(SSE_StoreAligned,                                "StoreAligned",                                 SSE,          -1,              16,           2,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_movaps,         INS_invalid},           HW_Category_MemoryStore,            HW_Flag_NoContainment|HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(SSE_StoreAlignedNonTemporal,                     "StoreAlignedNonTemporal",                      SSE,          -1,              16,           2,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_movntps,        INS_invalid},           HW_Category_MemoryStore,            HW_Flag_NoContainment|HW_Flag_NoRMWSemantics)
@@ -387,7 +387,7 @@ HARDWARE_INTRINSIC(AVX_SetAllVector256,                             "SetAllVecto
 HARDWARE_INTRINSIC(AVX_SetZeroVector256,                            "SetZeroVector256",                             AVX,          -1,              32,           0,     {INS_pxor,              INS_pxor,           INS_pxor,           INS_pxor,           INS_pxor,           INS_pxor,           INS_pxor,           INS_pxor,           INS_xorps,          INS_xorpd},             HW_Category_Helper,                 HW_Flag_NoContainment|HW_Flag_OneTypeGeneric|HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(AVX_Shuffle,                                     "Shuffle",                                      AVX,          -1,              32,           3,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_shufps,         INS_shufpd},            HW_Category_IMM,                    HW_Flag_NoRMWSemantics|HW_Flag_FullRangeIMM)
 HARDWARE_INTRINSIC(AVX_Sqrt,                                        "Sqrt",                                         AVX,          -1,              32,           1,     {INS_invalid,           INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_invalid,        INS_sqrtps,         INS_sqrtpd},            HW_Category_SimpleSIMD,             HW_Flag_NoRMWSemantics)
-HARDWARE_INTRINSIC(AVX_StaticCast,                                  "StaticCast",                                   AVX,          -1,              32,           1,     {INS_movdqa,            INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movaps,         INS_movapd},            HW_Category_Helper,                 HW_Flag_NoContainment|HW_Flag_TwoTypeGeneric|HW_Flag_NoRMWSemantics)
+HARDWARE_INTRINSIC(AVX_StaticCast,                                  "StaticCast",                                   AVX,          -1,              32,           1,     {INS_movdqa,            INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movaps,         INS_movapd},            HW_Category_Helper,                 HW_Flag_NoCodeGen|HW_Flag_TwoTypeGeneric)
 HARDWARE_INTRINSIC(AVX_Store,                                       "Store",                                        AVX,          -1,              32,           2,     {INS_movdqu,            INS_movdqu,         INS_movdqu,         INS_movdqu,         INS_movdqu,         INS_movdqu,         INS_movdqu,         INS_movdqu,         INS_movups,         INS_movupd},            HW_Category_MemoryStore,            HW_Flag_NoContainment|HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(AVX_StoreAligned,                                "StoreAligned",                                 AVX,          -1,              32,           2,     {INS_movdqa,            INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movdqa,         INS_movaps,         INS_movapd},            HW_Category_MemoryStore,            HW_Flag_NoContainment|HW_Flag_NoRMWSemantics)
 HARDWARE_INTRINSIC(AVX_StoreAlignedNonTemporal,                     "StoreAlignedNonTemporal",                      AVX,          -1,              32,           2,     {INS_movntdq,           INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_movntdq,        INS_movntps,        INS_movntpd},           HW_Category_MemoryStore,            HW_Flag_NoContainment|HW_Flag_NoRMWSemantics)
index 5cc91d7..1fe22cf 100644 (file)
@@ -905,6 +905,18 @@ GenTree* Compiler::impSSEIntrinsic(NamedIntrinsic        intrinsic,
             break;
         }
 
+        case NI_SSE_StaticCast:
+        {
+            // We fold away the static cast here, as it only exists to satisfy
+            // the type system. It is safe to do this here since the retNode type
+            // and the signature return type are both TYP_SIMD16.
+            assert(sig->numArgs == 1);
+            retNode = impSIMDPopStack(TYP_SIMD16, false, sig->retTypeClass);
+            SetOpLclRelatedToSIMDIntrinsic(retNode);
+            assert(retNode->gtType == getSIMDTypeForSize(getSIMDTypeSizeInBytes(sig->retTypeSigClass)));
+            break;
+        }
+
         case NI_SSE_StoreFence:
             assert(sig->numArgs == 0);
             assert(JITtype2varType(sig->retType) == TYP_VOID);
@@ -1214,6 +1226,18 @@ GenTree* Compiler::impAvxOrAvx2Intrinsic(NamedIntrinsic        intrinsic,
             break;
         }
 
+        case NI_AVX_StaticCast:
+        {
+            // We fold away the static cast here, as it only exists to satisfy
+            // the type system. It is safe to do this here since the retNode type
+            // and the signature return type are both TYP_SIMD32.
+            assert(sig->numArgs == 1);
+            retNode = impSIMDPopStack(TYP_SIMD32, false, sig->retTypeClass);
+            SetOpLclRelatedToSIMDIntrinsic(retNode);
+            assert(retNode->gtType == getSIMDTypeForSize(getSIMDTypeSizeInBytes(sig->retTypeSigClass)));
+            break;
+        }
+
         case NI_AVX_ExtractVector128:
         case NI_AVX2_ExtractVector128:
         {
index 0fafa77..3837a96 100644 (file)
@@ -6112,9 +6112,9 @@ void Compiler::impCheckForPInvokeCall(
             return;
         }
 
-        // PInvoke CALL in IL stubs must be inlined on CoreRT. Skip the ambient conditions checks and
-        // profitability checks
-        if (!(opts.jitFlags->IsSet(JitFlags::JIT_FLAG_IL_STUB) && IsTargetAbi(CORINFO_CORERT_ABI)))
+        // Legal PInvoke CALL in PInvoke IL stubs must be inlined to avoid infinite recursive
+        // inlining in CoreRT. Skip the ambient conditions checks and profitability checks.
+        if (!IsTargetAbi(CORINFO_CORERT_ABI) || (info.compFlags & CORINFO_FLG_PINVOKE) == 0)
         {
             if (!impCanPInvokeInline())
             {
index c912a2d..4787e45 100644 (file)
@@ -2401,8 +2401,69 @@ bool Lowering::IsContainableHWIntrinsicOp(GenTreeHWIntrinsic* containingNode, Ge
                     break;
                 }
 
-                case NI_SSE2_Insert:
                 case NI_SSE41_Insert:
+                {
+                    if (containingNode->gtSIMDBaseType == TYP_FLOAT)
+                    {
+                        assert(supportsSIMDScalarLoads == false);
+
+                        GenTree* op1 = containingNode->gtGetOp1();
+                        GenTree* op2 = containingNode->gtGetOp2();
+                        GenTree* op3 = nullptr;
+
+                        assert(op1->OperIsList());
+                        assert(containingNode->gtGetOp2() == nullptr);
+
+                        GenTreeArgList* argList = op1->AsArgList();
+
+                        op1     = argList->Current();
+                        argList = argList->Rest();
+
+                        op2     = argList->Current();
+                        argList = argList->Rest();
+
+                        assert(node == op2);
+
+                        op3 = argList->Current();
+
+                        // The upper two bits of the immediate value are ignored if
+                        // op2 comes from memory. In order to support using the upper
+                        // bits, we need to disable containment support if op3 is not
+                        // constant or if the constant is greater than 0x3F (which means
+                        // at least one of the upper two bits is set).
+
+                        if (op3->IsCnsIntOrI())
+                        {
+                            ssize_t ival = op3->AsIntCon()->IconValue();
+                            assert((ival >= 0) && (ival <= 255));
+
+                            if (ival <= 0x3F)
+                            {
+                                supportsAlignedSIMDLoads   = !comp->canUseVexEncoding();
+                                supportsUnalignedSIMDLoads = !supportsAlignedSIMDLoads;
+                                supportsGeneralLoads       = supportsUnalignedSIMDLoads;
+
+                                break;
+                            }
+                        }
+
+                        assert(supportsAlignedSIMDLoads == false);
+                        assert(supportsUnalignedSIMDLoads == false);
+                        assert(supportsGeneralLoads == false);
+                    }
+                    else
+                    {
+                        assert(supportsAlignedSIMDLoads == false);
+                        assert(supportsUnalignedSIMDLoads == false);
+
+                        supportsSIMDScalarLoads = true;
+                        supportsGeneralLoads    = supportsSIMDScalarLoads;
+                    }
+
+                    break;
+                }
+
+                case NI_SSE2_Insert:
                 case NI_AVX_CompareScalar:
                 {
                     assert(supportsAlignedSIMDLoads == false);
index a2dcddf..3338cbd 100644 (file)
@@ -2684,8 +2684,7 @@ regNumber LinearScan::tryAllocateFreeReg(Interval* currentInterval, RefPosition*
         {
             // Don't use the relatedInterval for preferencing if its next reference is not a new definition,
             // or if it is only related because they are multi-reg targets of the same node.
-            if (!RefTypeIsDef(nextRelatedRefPosition->refType) ||
-                isMultiRegRelated(nextRelatedRefPosition, refPosition->nodeLocation))
+            if (!RefTypeIsDef(nextRelatedRefPosition->refType))
             {
                 relatedInterval = nullptr;
             }
@@ -4919,18 +4918,6 @@ bool LinearScan::registerIsFree(regNumber regNum, RegisterType regType)
     return isFree;
 }
 
-// isMultiRegRelated: is this RefPosition defining part of a multi-reg value
-//                    at the given location?
-//
-bool LinearScan::isMultiRegRelated(RefPosition* refPosition, LsraLocation location)
-{
-#ifdef FEATURE_MULTIREG_ARGS_OR_RET
-    return ((refPosition->nodeLocation == location) && refPosition->getInterval()->isMultiReg);
-#else
-    return false;
-#endif
-}
-
 //------------------------------------------------------------------------
 // LinearScan::freeRegister: Make a register available for use
 //
@@ -8596,10 +8583,6 @@ void Interval::dump()
     {
         printf(" (constant)");
     }
-    if (isMultiReg)
-    {
-        printf(" (multireg)");
-    }
 
     printf(" RefPositions {");
     for (RefPosition* refPosition = this->firstRefPosition; refPosition != nullptr;
index e646294..f88f2d9 100644 (file)
@@ -1056,7 +1056,6 @@ private:
     regMaskTP allSIMDRegs();
     regMaskTP internalFloatRegCandidates();
 
-    bool isMultiRegRelated(RefPosition* refPosition, LsraLocation location);
     bool registerIsFree(regNumber regNum, RegisterType regType);
     bool registerIsAvailable(RegRecord*    physRegRecord,
                              LsraLocation  currentLoc,
@@ -1655,7 +1654,6 @@ public:
         , isSpecialPutArg(false)
         , preferCalleeSave(false)
         , isConstant(false)
-        , isMultiReg(false)
         , physReg(REG_COUNT)
 #ifdef DEBUG
         , intervalIndex(0)
@@ -1726,9 +1724,6 @@ public:
     // able to reuse a constant that's already in a register.
     bool isConstant : 1;
 
-    // True if this Interval is defined by a node that produces multiple registers.
-    bool isMultiReg : 1;
-
     // The register to which it is currently assigned.
     regNumber physReg;
 
index bf68d0b..6fe9d06 100644 (file)
@@ -434,13 +434,16 @@ int LinearScan::BuildNode(GenTree* tree)
             setDelayFree(locationUse);
             RefPosition* valueUse = BuildUse(tree->gtCmpXchg.gtOpValue);
             setDelayFree(valueUse);
-            if (!cmpXchgNode->gtOpComparand->isContained() && !compiler->compSupports(InstructionSet_Atomics))
+            if (!cmpXchgNode->gtOpComparand->isContained())
             {
+                RefPosition* comparandUse = BuildUse(tree->gtCmpXchg.gtOpComparand);
+
                 // For ARMv8 exclusives the lifetime of the comparand must be extended because
                 // it may be used used multiple during retries
-
-                RefPosition* comparandUse = BuildUse(tree->gtCmpXchg.gtOpComparand);
-                setDelayFree(comparandUse);
+                if (!compiler->compSupports(InstructionSet_Atomics))
+                {
+                    setDelayFree(comparandUse);
+                }
             }
 
             // Internals may not collide with target
@@ -465,17 +468,20 @@ int LinearScan::BuildNode(GenTree* tree)
                 {
                     buildInternalIntRegisterDefForNode(tree);
                 }
+            }
 
-                // For ARMv8 exclusives the lifetime of the addr and data must be extended because
-                // it may be used used multiple during retries
-                assert(!tree->gtGetOp1()->isContained());
-                RefPosition* op1Use = BuildUse(tree->gtGetOp1());
-                RefPosition* op2Use = nullptr;
-                if (!tree->gtGetOp2()->isContained())
-                {
-                    op2Use = BuildUse(tree->gtGetOp2());
-                }
+            assert(!tree->gtGetOp1()->isContained());
+            RefPosition* op1Use = BuildUse(tree->gtGetOp1());
+            RefPosition* op2Use = nullptr;
+            if (!tree->gtGetOp2()->isContained())
+            {
+                op2Use = BuildUse(tree->gtGetOp2());
+            }
 
+            // For ARMv8 exclusives the lifetime of the addr and data must be extended because
+            // it may be used used multiple during retries
+            if (!compiler->compSupports(InstructionSet_Atomics))
+            {
                 // Internals may not collide with target
                 if (dstCount == 1)
                 {
index 5383efa..089e80f 100644 (file)
@@ -2384,11 +2384,9 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree)
             }
 
             case NI_SSE_ConvertToSingle:
-            case NI_SSE_StaticCast:
             case NI_SSE2_ConvertToDouble:
             case NI_AVX_ExtendToVector256:
             case NI_AVX_GetLowerHalf:
-            case NI_AVX_StaticCast:
             {
                 assert(numArgs == 1);
                 assert(!isRMW);
index e622408..224c340 100644 (file)
@@ -1017,12 +1017,15 @@ const SIMDIntrinsicInfo* Compiler::getSIMDIntrinsicInfo(CORINFO_CLASS_HANDLE* in
 // Arguments:
 //    type        -  the type of value that the caller expects to be popped off the stack.
 //    expectAddr  -  if true indicates we are expecting type stack entry to be a TYP_BYREF.
+//    structType  -  the class handle to use when normalizing if it is not the same as the stack entry class handle;
+//                   this can happen for certain scenarios, such as folding away a static cast, where we want the
+//                   value popped to have the type that would have been returned.
 //
 // Notes:
 //    If the popped value is a struct, and the expected type is a simd type, it will be set
 //    to that type, otherwise it will assert if the type being popped is not the expected type.
 
-GenTree* Compiler::impSIMDPopStack(var_types type, bool expectAddr)
+GenTree* Compiler::impSIMDPopStack(var_types type, bool expectAddr, CORINFO_CLASS_HANDLE structType)
 {
     StackEntry se   = impPopStack();
     typeInfo   ti   = se.seTypeInfo;
@@ -1066,8 +1069,13 @@ GenTree* Compiler::impSIMDPopStack(var_types type, bool expectAddr)
     if (varTypeIsStruct(tree) && ((tree->OperGet() == GT_RET_EXPR) || (tree->OperGet() == GT_CALL) || isParam))
     {
         assert(ti.IsType(TI_STRUCT));
-        CORINFO_CLASS_HANDLE structType = ti.GetClassHandleForValueClass();
-        tree                            = impNormStructVal(tree, structType, (unsigned)CHECK_SPILL_ALL);
+
+        if (structType == nullptr)
+        {
+            structType = ti.GetClassHandleForValueClass();
+        }
+
+        tree = impNormStructVal(tree, structType, (unsigned)CHECK_SPILL_ALL);
     }
 
     // Now set the type of the tree to the specialized SIMD struct type, if applicable.
index 46c941f..4fc3258 100644 (file)
@@ -76,22 +76,6 @@ LOCAL_LABEL(Done_CONTEXT_CONTROL):
     fxsave  [rdi + CONTEXT_FltSave]
 LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT):
 
-    test    BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_DEBUG_REGISTERS
-    je      LOCAL_LABEL(Done_CONTEXT_DEBUG_REGISTERS)
-    mov     rdx, dr0
-    mov     [rdi + CONTEXT_Dr0], rdx
-    mov     rdx, dr1
-    mov     [rdi + CONTEXT_Dr1], rdx
-    mov     rdx, dr2
-    mov     [rdi + CONTEXT_Dr2], rdx
-    mov     rdx, dr3
-    mov     [rdi + CONTEXT_Dr3], rdx
-    mov     rdx, dr6
-    mov     [rdi + CONTEXT_Dr6], rdx
-    mov     rdx, dr7
-    mov     [rdi + CONTEXT_Dr7], rdx
-LOCAL_LABEL(Done_CONTEXT_DEBUG_REGISTERS):
-
     free_stack 8
     ret
 LEAF_END CONTEXT_CaptureContext, _TEXT
@@ -107,31 +91,15 @@ LEAF_ENTRY RtlRestoreContext, _TEXT
 
 #ifdef HAS_ASAN
     test    BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_CONTROL
-    je      LOCAL_LABEL(Restore_CONTEXT_DEBUG_REGISTERS)
+    je      LOCAL_LABEL(Restore_CONTEXT_FLOATING_POINT)
 
     push_nonvol_reg rdi
     push_nonvol_reg rsi
     call    EXTERNAL_C_FUNC(__asan_handle_no_return)
     pop_nonvol_reg rsi
     pop_nonvol_reg rdi
-LOCAL_LABEL(Restore_CONTEXT_DEBUG_REGISTERS):
+LOCAL_LABEL(Restore_CONTEXT_FLOATING_POINT):
 #endif
-    test    BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_DEBUG_REGISTERS
-    je      LOCAL_LABEL(Done_Restore_CONTEXT_DEBUG_REGISTERS)
-    mov     rdx, [rdi + CONTEXT_Dr0]
-    mov     dr0, rdx
-    mov     rdx, [rdi + CONTEXT_Dr1]
-    mov     dr1, rdx
-    mov     rdx, [rdi + CONTEXT_Dr2]
-    mov     dr2, rdx
-    mov     rdx, [rdi + CONTEXT_Dr3]
-    mov     dr3, rdx
-    mov     rdx, [rdi + CONTEXT_Dr6]
-    mov     dr6, rdx
-    mov     rdx, [rdi + CONTEXT_Dr7]
-    mov     dr7, rdx
-LOCAL_LABEL(Done_Restore_CONTEXT_DEBUG_REGISTERS):
-
     test    BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_FLOATING_POINT
     je      LOCAL_LABEL(Done_Restore_CONTEXT_FLOATING_POINT)
     fxrstor [rdi + CONTEXT_FltSave]
index 5795a4d..1bde74a 100644 (file)
@@ -39,7 +39,7 @@ manifestTypeToCSharpTypeMap = {
     "win:UInt32" : "UInt32",
     "win:UInt64" : "UInt64",
     "win:Int32" : "Int32",
-    "win:Pointer" : "UIntPtr",
+    "win:Pointer" : "IntPtr",
     "win:UnicodeString" : "string",
     "win:Binary" : "byte[]",
     "win:Double" : "double",
@@ -116,7 +116,7 @@ def generateEvent(eventNode, providerNode, outputFile, stringTable):
         # Calculate the number of arguments.
         for argumentNode in argumentNodes:
             if argumentNode.nodeName == "data":
-                if argumentNode.getAttribute("inType") != "win:Binary" and argumentNode.getAttribute("inType") != "win:AnsiString":
+                if argumentNode.getAttribute("inType") != "win:Binary" and argumentNode.getAttribute("inType") != "win:AnsiString" and argumentNode.getAttribute("count") == "":
                     argumentCount += 1
                 else:
                     break
@@ -181,9 +181,26 @@ def generateEvents(providerNode, outputFile, stringTable):
         eventsNode = node
         break
 
+    # Get the list of event nodes.
+    eventNodes = eventsNode.getElementsByTagName("event")
+
+    # Build a list of events to be emitted.  This is where old versions of events are stripped.
+    # key = eventID, value = version
+    eventList = dict()
+    for eventNode in eventNodes:
+        eventID = eventNode.getAttribute("value")
+        eventVersion = eventNode.getAttribute("version")
+        eventList[eventID] = eventVersion
+
     # Iterate over each event node and process it.
-    for eventNode in eventsNode.getElementsByTagName("event"):
-        generateEvent(eventNode, providerNode, outputFile, stringTable)
+    # Only emit events for the latest version of the event, otherwise EventSource initialization will fail.
+    for eventNode in eventNodes:
+        eventID = eventNode.getAttribute("value")
+        eventVersion = eventNode.getAttribute("version")
+        if eventID in eventList and eventList[eventID] == eventVersion:
+            generateEvent(eventNode, providerNode, outputFile, stringTable)
+        elif eventID not in eventList:
+            raise ValueError("eventID could not be found in the list of events to emit.", eventID)
 
 def generateValueMapEnums(providerNode, outputFile, stringTable, enumTypeMap):
 
@@ -355,11 +372,19 @@ namespace System.Diagnostics.Tracing
 """
             writeOutput(outputFile, header)
             increaseTabLevel()
-            writeOutput(outputFile, "[EventSource(Name = \"" + providerName + "\", Guid = \"" + providerNode.getAttribute("guid") + "\")]\n")
-            writeOutput(outputFile, "internal sealed unsafe class " + providerNameToClassNameMap[providerName] + " : EventSource\n")
+
+            className = providerNameToClassNameMap[providerName]
+            writeOutput(outputFile, "[EventSource(Name = \"" + providerName + "\")]\n")
+            writeOutput(outputFile, "internal sealed partial class " + className + " : EventSource\n")
             writeOutput(outputFile, "{\n")
             increaseTabLevel()
 
+            # Create a static property for the EventSource name so that we don't have to initialize the EventSource to get its name.
+            writeOutput(outputFile, "internal const string EventSourceName = \"" + providerName + "\";\n")
+
+            # Write the static Log property.
+            writeOutput(outputFile, "internal static " + className + " Log = new " + className + "();\n\n")
+
             # Write the keywords class.
             generateKeywordsClass(providerNode, outputFile)
 
index 441f0a0..1081477 100644 (file)
@@ -75,6 +75,8 @@
                              message="$(string.RuntimePublisher.MonitoringKeywordMessage)" symbol="CLR_MONITORING_KEYWORD" />
                     <keyword name="CodeSymbolsKeyword" mask="0x400000000"
                              message="$(string.RuntimePublisher.CodeSymbolsKeywordMessage)" symbol="CLR_CODESYMBOLS_KEYWORD" />
+                    <keyword name="EventSourceKeyword" mask="0x800000000"
+                             message="$(string.RuntimePublisher.EventSourceKeywordMessage)" symbol="CLR_EVENTSOURCE_KEYWORD" />
                 </keywords>
                 <!--Tasks-->
                 <tasks>
                            symbol="CodeSymbols" message="$(string.RuntimePublisher.CodeSymbolsEventMessage)"/>
                     
                    <event value="270" version="0" level="win:Informational"  template="EventSource"
-                           opcode="win:Start"
+                           keywords="EventSourceKeyword"
                            symbol="EventSource" />
                 </events>
             </provider>
                 <string id="RuntimePublisher.DebuggerKeywordMessage" value="Debugger" />
                 <string id="RuntimePublisher.MonitoringKeywordMessage" value="Monitoring" />
                 <string id="RuntimePublisher.CodeSymbolsKeywordMessage" value="CodeSymbols" />
+                <string id="RuntimePublisher.EventSourceKeywordMessage" value="EventSource" />
                 <string id="RundownPublisher.LoaderKeywordMessage" value="Loader" />
                 <string id="RundownPublisher.JitKeywordMessage" value="Jit" />
                 <string id="RundownPublisher.JittedMethodILToNativeMapRundownKeywordMessage" value="JittedMethodILToNativeMapRundown" />
index e1f1110..e575ded 100644 (file)
@@ -433,6 +433,7 @@ FCFuncStart(gCOMClassWriter)
     QCFuncElement("SetFieldLayoutOffset", COMDynamicWrite::SetFieldLayoutOffset)
     QCFuncElement("SetClassLayout", COMDynamicWrite::SetClassLayout)
     QCFuncElement("SetParamInfo", COMDynamicWrite::SetParamInfo)
+    QCFuncElement("SetPInvokeData", COMDynamicWrite::SetPInvokeData)
     QCFuncElement("SetConstantValue", COMDynamicWrite::SetConstantValue)
     QCFuncElement("DefineCustomAttribute", COMDynamicWrite::DefineCustomAttribute)
 FCFuncEnd()
@@ -1180,8 +1181,10 @@ FCFuncStart(gEventPipeInternalFuncs)
     QCFuncElement("DefineEvent", EventPipeInternal::DefineEvent)
     QCFuncElement("DeleteProvider", EventPipeInternal::DeleteProvider)
     QCFuncElement("EventActivityIdControl", EventPipeInternal::EventActivityIdControl)
+    QCFuncElement("GetProvider", EventPipeInternal::GetProvider)
     QCFuncElement("WriteEvent", EventPipeInternal::WriteEvent)
     QCFuncElement("WriteEventData", EventPipeInternal::WriteEventData)
+    QCFuncElement("GetNextEvent", EventPipeInternal::GetNextEvent)
 FCFuncEnd()
 #endif // FEATURE_PERFTRACING
 
index fb112db..00e740e 100644 (file)
@@ -221,6 +221,7 @@ void EventPipe::EnableOnStartup()
 
         // Create a new session.
         EventPipeSession *pSession = new EventPipeSession(
+            EventPipeSessionType::File,
             1024 /* 1 GB circular buffer */,
             NULL, /* pProviders */
             0 /* numProviders */);
@@ -293,7 +294,11 @@ void EventPipe::Enable(
     CONTRACTL_END;
 
     // Create a new session.
-    EventPipeSession *pSession = s_pConfig->CreateSession(circularBufferSizeInMB, pProviders, static_cast<unsigned int>(numProviders));
+    EventPipeSession *pSession = s_pConfig->CreateSession(
+        (strOutputPath != NULL) ? EventPipeSessionType::File : EventPipeSessionType::Streaming,
+        circularBufferSizeInMB,
+        pProviders,
+        static_cast<unsigned int>(numProviders));
 
     // Enable the session.
     Enable(strOutputPath, pSession);
@@ -329,8 +334,13 @@ void EventPipe::Enable(LPCWSTR strOutputPath, EventPipeSession *pSession)
     CrstHolder _crst(GetLock());
 
     // Create the event pipe file.
-    SString eventPipeFileOutputPath(strOutputPath);
-    s_pFile = new EventPipeFile(eventPipeFileOutputPath);
+    // A NULL output path means that we should not write the results to a file.
+    // This is used in the EventListener streaming case.
+    if (strOutputPath != NULL)
+    {
+        SString eventPipeFileOutputPath(strOutputPath);
+        s_pFile = new EventPipeFile(eventPipeFileOutputPath);
+    }
 
 #ifdef _DEBUG
     if((CLRConfig::GetConfigValue(CLRConfig::INTERNAL_EnableEventPipe) & 2) == 2)
@@ -395,39 +405,39 @@ void EventPipe::Disable()
         FlushProcessWriteBuffers();
 
         // Write to the file.
-        LARGE_INTEGER disableTimeStamp;
-        QueryPerformanceCounter(&disableTimeStamp);
-        s_pBufferManager->WriteAllBuffersToFile(s_pFile, disableTimeStamp);
-
-        if(CLRConfig::GetConfigValue(CLRConfig::INTERNAL_EventPipeRundown) > 0)
+        if(s_pFile != NULL)
         {
-            // Before closing the file, do rundown.
-            const unsigned int numRundownProviders = 2;
-            EventPipeProviderConfiguration rundownProviders[] =
-            {
-                { W("Microsoft-Windows-DotNETRuntime"), 0x80020138, static_cast<unsigned int>(EventPipeEventLevel::Verbose) }, // Public provider.
-                { W("Microsoft-Windows-DotNETRuntimeRundown"), 0x80020138, static_cast<unsigned int>(EventPipeEventLevel::Verbose) } // Rundown provider.
-            };
-            // The circular buffer size doesn't matter because all events are written synchronously during rundown.
-            s_pSession = s_pConfig->CreateSession(1 /* circularBufferSizeInMB */, rundownProviders, numRundownProviders);
-            s_pConfig->EnableRundown(s_pSession);
-
-            // Ask the runtime to emit rundown events.
-            if(g_fEEStarted && !g_fEEShutDown)
+            LARGE_INTEGER disableTimeStamp;
+            QueryPerformanceCounter(&disableTimeStamp);
+            s_pBufferManager->WriteAllBuffersToFile(s_pFile, disableTimeStamp);
+
+            if(CLRConfig::GetConfigValue(CLRConfig::INTERNAL_EventPipeRundown) > 0)
             {
-                ETW::EnumerationLog::EndRundown();
-            }
+                // Before closing the file, do rundown.
+                const unsigned int numRundownProviders = 2;
+                EventPipeProviderConfiguration rundownProviders[] =
+                {
+                    { W("Microsoft-Windows-DotNETRuntime"), 0x80020138, static_cast<unsigned int>(EventPipeEventLevel::Verbose) }, // Public provider.
+                    { W("Microsoft-Windows-DotNETRuntimeRundown"), 0x80020138, static_cast<unsigned int>(EventPipeEventLevel::Verbose) } // Rundown provider.
+                };
+                // The circular buffer size doesn't matter because all events are written synchronously during rundown.
+                s_pSession = s_pConfig->CreateSession(EventPipeSessionType::File, 1 /* circularBufferSizeInMB */, rundownProviders, numRundownProviders);
+                s_pConfig->EnableRundown(s_pSession);
+
+                // Ask the runtime to emit rundown events.
+                if(g_fEEStarted && !g_fEEShutDown)
+                {
+                    ETW::EnumerationLog::EndRundown();
+                }
 
-            // Disable the event pipe now that rundown is complete.
-            s_pConfig->Disable(s_pSession);
+                // Disable the event pipe now that rundown is complete.
+                s_pConfig->Disable(s_pSession);
 
-            // Delete the rundown session.
-            s_pConfig->DeleteSession(s_pSession);
-            s_pSession = NULL;
-        }
+                // Delete the rundown session.
+                s_pConfig->DeleteSession(s_pSession);
+                s_pSession = NULL;
+            }
 
-        if(s_pFile != NULL)
-        {
             delete(s_pFile);
             s_pFile = NULL;
         }
@@ -486,6 +496,25 @@ EventPipeProvider* EventPipe::CreateProvider(const SString &providerName, EventP
 
 }
 
+EventPipeProvider* EventPipe::GetProvider(const SString &providerName)
+{
+    CONTRACTL
+    {
+        THROWS;
+        GC_NOTRIGGER;
+        MODE_ANY;
+    }
+    CONTRACTL_END;
+
+    EventPipeProvider *pProvider = NULL;
+    if (s_pConfig != NULL)
+    {
+        pProvider = s_pConfig->GetProvider(providerName);
+    }
+
+    return pProvider;
+}
+
 void EventPipe::DeleteProvider(EventPipeProvider *pProvider)
 {
     CONTRACTL
@@ -975,6 +1004,28 @@ void EventPipe::SaveCommandLine(LPCWSTR pwzAssemblyPath, int argc, LPCWSTR *argv
 #endif
 }
 
+EventPipeEventInstance* EventPipe::GetNextEvent()
+{
+    CONTRACTL
+    {
+        THROWS;
+        GC_TRIGGERS;
+        MODE_PREEMPTIVE;
+    }
+    CONTRACTL_END;
+
+    EventPipeEventInstance *pInstance = NULL;
+
+    // Only fetch the next event if a tracing session exists.
+    // The buffer manager is not disposed until the process is shutdown.
+    if (s_pSession != NULL)
+    {
+        pInstance = s_pBufferManager->GetNextEvent();
+    }
+
+    return pInstance;
+}
+
 void QCALLTYPE EventPipeInternal::Enable(
         __in_z LPCWSTR outputFile,
         UINT32 circularBufferSizeInMB,
@@ -1041,6 +1092,22 @@ INT_PTR QCALLTYPE EventPipeInternal::DefineEvent(
     return reinterpret_cast<INT_PTR>(pEvent);
 }
 
+INT_PTR QCALLTYPE EventPipeInternal::GetProvider(
+    __in_z LPCWSTR providerName)
+{
+    QCALL_CONTRACT;
+
+    EventPipeProvider *pProvider = NULL;
+
+    BEGIN_QCALL;
+    
+    pProvider = EventPipe::GetProvider(providerName);
+
+    END_QCALL;
+
+    return reinterpret_cast<INT_PTR>(pProvider);
+}
+
 void QCALLTYPE EventPipeInternal::DeleteProvider(
     INT_PTR provHandle)
 {
@@ -1153,4 +1220,27 @@ void QCALLTYPE EventPipeInternal::WriteEventData(
     END_QCALL;
 }
 
+bool QCALLTYPE EventPipeInternal::GetNextEvent(
+    EventPipeEventInstanceData *pInstance)
+{
+    QCALL_CONTRACT;
+
+    EventPipeEventInstance *pNextInstance = NULL;
+    BEGIN_QCALL;
+
+    _ASSERTE(pInstance != NULL);
+
+    pNextInstance = EventPipe::GetNextEvent();
+    if (pNextInstance)
+    {
+        pInstance->ProviderID = pNextInstance->GetEvent()->GetProvider();
+        pInstance->EventID = pNextInstance->GetEvent()->GetEventID();
+        pInstance->Payload = pNextInstance->GetData();
+        pInstance->PayloadLength = pNextInstance->GetDataLength();
+    }
+
+    END_QCALL;
+    return pNextInstance != NULL;
+} 
+
 #endif // FEATURE_PERFTRACING
index 2becb5c..1904d45 100644 (file)
@@ -12,6 +12,7 @@ class CrstStatic;
 class CrawlFrame;
 class EventPipeConfiguration;
 class EventPipeEvent;
+class EventPipeEventInstance;
 class EventPipeFile;
 class EventPipeJsonFile;
 class EventPipeBuffer;
@@ -250,6 +251,9 @@ class EventPipe
         // Create a provider.
         static EventPipeProvider* CreateProvider(const SString &providerName, EventPipeCallback pCallbackFunction = NULL, void *pCallbackData = NULL);
 
+        // Get a provider.
+        static EventPipeProvider* GetProvider(const SString &providerName);
+
         // Delete a provider.
         static void DeleteProvider(EventPipeProvider *pProvider);
 
@@ -273,6 +277,9 @@ class EventPipe
         // Save the command line for the current process.
         static void SaveCommandLine(LPCWSTR pwzAssemblyPath, int argc, LPCWSTR *argv);
 
+        // Get next event.
+        static EventPipeEventInstance* GetNextEvent();
+
     protected:
 
         // The counterpart to WriteEvent which after the payload is constructed
@@ -373,6 +380,15 @@ private:
         EVENT_ACTIVITY_CONTROL_CREATE_SET_ID = 5
     };
 
+    struct EventPipeEventInstanceData
+    {
+    public:
+        void *ProviderID;
+        unsigned int EventID;
+        const BYTE *Payload;
+        unsigned int PayloadLength;
+    };
+
 public:
 
     static void QCALLTYPE Enable(
@@ -397,6 +413,9 @@ public:
         void *pMetadata,
         UINT32 metadataLength);
 
+    static INT_PTR QCALLTYPE GetProvider(
+        __in_z LPCWSTR providerName);
+
     static void QCALLTYPE DeleteProvider(
         INT_PTR provHandle);
 
@@ -417,6 +436,9 @@ public:
         EventData *pEventData,
         UINT32 eventDataCount,
         LPCGUID pActivityId, LPCGUID pRelatedActivityId);
+
+    static bool QCALLTYPE GetNextEvent(
+        EventPipeEventInstanceData *pInstance); 
 };
 
 #endif // FEATURE_PERFTRACING
index 5f09295..060707b 100644 (file)
@@ -29,6 +29,7 @@ EventPipeBufferManager::EventPipeBufferManager()
     m_numBuffersStolen = 0;
     m_numBuffersLeaked = 0;
     m_numEventsStored = 0;
+    m_numEventsDropped = 0;
     m_numEventsWritten = 0;
 #endif // _DEBUG
 }
@@ -76,7 +77,7 @@ EventPipeBufferManager::~EventPipeBufferManager()
     }
 }
 
-EventPipeBuffer* EventPipeBufferManager::AllocateBufferForThread(Thread *pThread, unsigned int requestSize)
+EventPipeBuffer* EventPipeBufferManager::AllocateBufferForThread(EventPipeSession &session, Thread *pThread, unsigned int requestSize)
 {
     CONTRACTL
     {
@@ -133,11 +134,14 @@ EventPipeBuffer* EventPipeBufferManager::AllocateBufferForThread(Thread *pThread
         }
     }
 
+    // Only steal buffers from other threads if the session being written to is a
+    // file-based session.  Streaming sessions will simply drop events.
+    // TODO: Add dropped events telemetry here.
     EventPipeBuffer *pNewBuffer = NULL;
-    if(!allocateNewBuffer)
+    if(!allocateNewBuffer && (session.GetSessionType() == EventPipeSessionType::File))
     {
         // We can't allocate a new buffer.
-        // Find the oldest buffer, zero it, and re-purpose it for this thread.
+        // Find the oldest buffer, de-allocate it, and re-purpose it for this thread.
 
         // Find the thread that contains the oldest stealable buffer, and get its list of buffers.
         EventPipeBufferList *pListToStealFrom = FindThreadToStealFrom();
@@ -179,7 +183,7 @@ EventPipeBuffer* EventPipeBufferManager::AllocateBufferForThread(Thread *pThread
         // Pick the base buffer size based.  Debug builds have a smaller size to stress the allocate/steal path more.
         unsigned int baseBufferSize =
 #ifdef _DEBUG
-            5 * 1024; // 5K
+            30 * 1024; // 30K
 #else
             100 * 1024; // 100K
 #endif
@@ -192,6 +196,13 @@ EventPipeBuffer* EventPipeBufferManager::AllocateBufferForThread(Thread *pThread
             bufferSize = requestSize;
         }
 
+        // Don't allow the buffer size to exceed 1MB.
+        const unsigned int maxBufferSize = 1024 * 1024;
+        if(bufferSize > maxBufferSize)
+        {
+            bufferSize = maxBufferSize;
+        }
+
         // EX_TRY is used here as opposed to new (nothrow) because
         // the constructor also allocates a private buffer, which
         // could throw, and cannot be easily checked
@@ -363,7 +374,7 @@ bool EventPipeBufferManager::WriteEvent(Thread *pThread, EventPipeSession &sessi
         // to switch to preemptive mode here.
 
         unsigned int requestSize = sizeof(EventPipeEventInstance) + payload.GetSize();
-        pBuffer = AllocateBufferForThread(pThread, requestSize);
+        pBuffer = AllocateBufferForThread(session, pThread, requestSize);
     }
 
     // Try to write the event after we allocated (or stole) a buffer.
@@ -382,6 +393,10 @@ bool EventPipeBufferManager::WriteEvent(Thread *pThread, EventPipeSession &sessi
     {
         InterlockedIncrement(&m_numEventsStored);
     }
+    else
+    {
+        InterlockedIncrement(&m_numEventsDropped);
+    }
 #endif // _DEBUG
     return !allocNewBuffer;
 }
@@ -458,6 +473,64 @@ void EventPipeBufferManager::WriteAllBuffersToFile(EventPipeFile *pFile, LARGE_I
     }
 }
 
+EventPipeEventInstance* EventPipeBufferManager::GetNextEvent()
+{
+    CONTRACTL
+    {
+        NOTHROW;
+        GC_NOTRIGGER;
+        MODE_ANY;
+    }
+    CONTRACTL_END;
+
+    // Take the lock before walking the buffer list.
+    SpinLockHolder _slh(&m_lock);
+
+    // Naively walk the circular buffer, getting the event stream in timestamp order.
+    LARGE_INTEGER stopTimeStamp;
+    QueryPerformanceCounter(&stopTimeStamp);
+    while (true)
+    {
+        EventPipeEventInstance *pOldestInstance = NULL;
+        EventPipeBuffer *pOldestContainingBuffer = NULL;
+        EventPipeBufferList *pOldestContainingList = NULL;
+        SListElem<EventPipeBufferList*> *pElem = m_pPerThreadBufferList->GetHead();
+        while (pElem != NULL)
+        {
+            EventPipeBufferList *pBufferList = pElem->GetValue();
+
+            // Peek the next event out of the list.
+            EventPipeBuffer *pContainingBuffer = NULL;
+            EventPipeEventInstance *pNext = pBufferList->PeekNextEvent(stopTimeStamp, &pContainingBuffer);
+            if (pNext != NULL)
+            {
+                // If it's the oldest event we've seen, then save it.
+                if ((pOldestInstance == NULL) ||
+                    (pOldestInstance->GetTimeStamp()->QuadPart > pNext->GetTimeStamp()->QuadPart))
+                {
+                    pOldestInstance = pNext;
+                    pOldestContainingBuffer = pContainingBuffer;
+                    pOldestContainingList = pBufferList;
+                }
+            }
+
+            pElem = m_pPerThreadBufferList->GetNext(pElem);
+        }
+
+        if (pOldestInstance == NULL)
+        {
+            // We're done.  There are no more events.
+            return NULL;
+        }
+
+        // Pop the event from the buffer.
+        pOldestContainingList->PopNextEvent(stopTimeStamp);
+
+        // Return the oldest event that hasn't yet been processed.
+        return pOldestInstance;
+    }
+}
+
 void EventPipeBufferManager::DeAllocateBuffers()
 {
     CONTRACTL
@@ -777,25 +850,22 @@ EventPipeEventInstance* EventPipeBufferList::PopNextEvent(LARGE_INTEGER beforeTi
     EventPipeBuffer *pContainingBuffer = NULL;
     EventPipeEventInstance *pNext = PeekNextEvent(beforeTimeStamp, &pContainingBuffer);
 
-    // If the event is non-NULL, pop it.
-    if(pNext != NULL && pContainingBuffer != NULL)
+    // Check to see if we need to clean-up the buffer that contained the previously popped event.
+    if(pContainingBuffer->GetPrevious() != NULL)
     {
-        pContainingBuffer->PopNext(beforeTimeStamp);
-
-        // If the buffer is not the last buffer in the list and it has been drained, de-allocate it.
-        if((pContainingBuffer->GetNext() != NULL) && (pContainingBuffer->PeekNext(beforeTimeStamp) == NULL))
-        {
-            // This buffer must be the head node of the list.
-            _ASSERTE(pContainingBuffer->GetPrevious() == NULL);
+            // Remove the previous node.  The previous node should always be the head node.
             EventPipeBuffer *pRemoved = GetAndRemoveHead();
-            _ASSERTE(pRemoved == pContainingBuffer);
+            _ASSERTE(pRemoved != pContainingBuffer);
+            _ASSERTE(pContainingBuffer == GetHead());
 
             // De-allocate the buffer.
             m_pManager->DeAllocateBuffer(pRemoved);
+    }
 
-            // Reset the read buffer so that it becomes the head node on next peek or pop operation.
-            m_pReadBuffer = NULL;
-        }
+    // If the event is non-NULL, pop it.
+    if(pNext != NULL && pContainingBuffer != NULL)
+    {
+        pContainingBuffer->PopNext(beforeTimeStamp);
     }
 
     return pNext;
index 87502ed..b72648a 100644 (file)
@@ -43,13 +43,14 @@ private:
     unsigned int m_numBuffersStolen;
     unsigned int m_numBuffersLeaked;
     Volatile<LONG> m_numEventsStored;
+    Volatile<LONG> m_numEventsDropped;
     LONG m_numEventsWritten;
 #endif // _DEBUG
 
     // Allocate a new buffer for the specified thread.
     // This function will store the buffer in the thread's buffer list for future use and also return it here.
     // A NULL return value means that a buffer could not be allocated.
-    EventPipeBuffer* AllocateBufferForThread(Thread *pThread, unsigned int requestSize);
+    EventPipeBuffer* AllocateBufferForThread(EventPipeSession &session, Thread *pThread, unsigned int requestSize);
 
     // Add a buffer to the thread buffer list.
     void AddBufferToThreadBufferList(EventPipeBufferList *pThreadBuffers, EventPipeBuffer *pBuffer);
@@ -82,6 +83,9 @@ public:
     // to free their buffer for a very long time.
     void DeAllocateBuffers();
 
+    // Get next event.  This is used to dispatch events to EventListener.
+    EventPipeEventInstance* GetNextEvent();
+
 #ifdef _DEBUG
     bool EnsureConsistency();
 #endif // _DEBUG
index 74d9f44..571b0f1 100644 (file)
@@ -309,7 +309,7 @@ size_t EventPipeConfiguration::GetCircularBufferSize() const
     return ret;
 }
 
-EventPipeSession* EventPipeConfiguration::CreateSession(unsigned int circularBufferSizeInMB, EventPipeProviderConfiguration *pProviders, unsigned int numProviders)
+EventPipeSession* EventPipeConfiguration::CreateSession(EventPipeSessionType sessionType, unsigned int circularBufferSizeInMB, EventPipeProviderConfiguration *pProviders, unsigned int numProviders)
 {
     CONTRACTL
     {
@@ -319,7 +319,7 @@ EventPipeSession* EventPipeConfiguration::CreateSession(unsigned int circularBuf
     }
     CONTRACTL_END;
 
-    return new EventPipeSession(circularBufferSizeInMB, pProviders, numProviders);
+    return new EventPipeSession(sessionType, circularBufferSizeInMB, pProviders, numProviders);
 }
 
 void EventPipeConfiguration::DeleteSession(EventPipeSession *pSession)
index 0f500bd..22b5cf9 100644 (file)
@@ -15,6 +15,7 @@ class EventPipeEventInstance;
 class EventPipeProvider;
 struct EventPipeProviderConfiguration;
 class EventPipeSession;
+enum class EventPipeSessionType;
 class EventPipeSessionProvider;
 
 enum class EventPipeEventLevel
@@ -53,7 +54,7 @@ public:
     EventPipeProvider* GetProvider(const SString &providerID);
 
     // Create a new session.
-    EventPipeSession* CreateSession(unsigned int circularBufferSizeInMB, EventPipeProviderConfiguration *pProviders, unsigned int numProviders);
+    EventPipeSession* CreateSession(EventPipeSessionType sessionType, unsigned int circularBufferSizeInMB, EventPipeProviderConfiguration *pProviders, unsigned int numProviders);
 
     // Delete a session.
     void DeleteSession(EventPipeSession *pSession);
index 7fd7ac1..5f6e415 100644 (file)
@@ -10,6 +10,7 @@
 #ifdef FEATURE_PERFTRACING
 
 EventPipeSession::EventPipeSession(
+    EventPipeSessionType sessionType,
     unsigned int circularBufferSizeInMB,
     EventPipeProviderConfiguration *pProviders,
     unsigned int numProviders)
@@ -22,6 +23,7 @@ EventPipeSession::EventPipeSession(
     }
     CONTRACTL_END;
 
+    m_sessionType = sessionType;
     m_circularBufferSizeInBytes = circularBufferSizeInMB * 1024 * 1024; // 1MB;
     m_rundownEnabled = false;
     m_pProviderList = new EventPipeSessionProviderList(
index ba91c60..c8c2e1f 100644 (file)
@@ -12,6 +12,12 @@ struct EventPipeProviderConfiguration;
 class EventPipeSessionProviderList;
 class EventPipeSessionProvider;
 
+enum class EventPipeSessionType
+{
+    File,
+    Streaming
+};
+
 class EventPipeSession
 {
 private:
@@ -24,10 +30,15 @@ private:
     // True if rundown is enabled.
     Volatile<bool> m_rundownEnabled;
 
+    // The type of the session.
+    // This determines behavior within the system (e.g. policies around which events to drop, etc.)
+    EventPipeSessionType m_sessionType;
+
 public:
 
     // TODO: This needs to be exposed via EventPipe::CreateSession() and EventPipe::DeleteSession() to avoid memory ownership issues.
     EventPipeSession(
+        EventPipeSessionType sessionType,
         unsigned int circularBufferSizeInMB,
         EventPipeProviderConfiguration *pProviders,
         unsigned int numProviders);
@@ -37,6 +48,13 @@ public:
     // Determine if the session is valid or not.  Invalid sessions can be detected before they are enabled.
     bool IsValid() const;
 
+    // Get the session type.
+    EventPipeSessionType GetSessionType() const
+    {
+        LIMITED_METHOD_CONTRACT;
+        return m_sessionType;
+    }
+
     // Get the configured size of the circular buffer.
     size_t GetCircularBufferSize() const
     {
index 8c79b96..9551d3f 100644 (file)
 // The expected format of this file can be found at https://github.com/dotnet/coreclr/blob/master/Documentation/building/testing-with-corefx.md
 [
     {
-        "name": "Microsoft.Win32.SystemEvents.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.PowerModeTests.SignalsPowerModeChanged",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.SessionEndingTests.CancelSessionEnding",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: 0\\r\\nActual:   1"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.SessionEndingTests.SignalsSessionEnding",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.PaletteChangedTests.SignalsEventsAsynchronouslyOnMessage",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.PaletteChangedTests.SignalsEventsSynchronouslyOnReflectedMessage",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.InvokeOnEventsThreadTests.InvokeOnEventsThreadRunsOnSameThreadAsOtherEvents",
-                    "reason": "Xunit.Sdk.NotEqualException Assert.NotEqual() Failure\\r\\nExpected: Not -1\\r\\nActual:   -1"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.LowMemoryTests.SignalsEventsAsynchronouslyOnMessage",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.LowMemoryTests.SignalsEventsSynchronouslyOnReflectedMessage",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.UserPreferenceTests.SignalsUserPreferenceEventsAsynchronouslyOnThemeChanged",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.UserPreferenceTests.SignalsUserPreferenceEventsSynchronously",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.SessionSwitchTests.SignalsSessionSwitch",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.TimeChangedTests.SignalsEventsAsynchronouslyOnMessage",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.TimeChangedTests.SignalsEventsSynchronouslyOnReflectedMessage",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.SessionEndedTests.SignalsSessionEnded",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.InstalledFontsChangedTests.SignalsEventsSynchronouslyOnReflectedMessage",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.InstalledFontsChangedTests.SignalsEventsAsynchronouslyOnMessage",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.DisplaySettingsTests.SignalsDisplayEventsAsynchronouslyOnDISPLAYCHANGE",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                },
-                {
-                    "name": "Microsoft.Win32.SystemEventsTests.DisplaySettingsTests.SignalsDisplayEventsSynchronouslyOnREFLECTDISPLAYCHANGE",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Collections.Concurrent.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Collections.Concurrent.Tests.ConcurrentDictionaryTests.TestAddNullValue_IDictionary_ReferenceType_null",
-                    "reason": "System.ArgumentException System.ArgumentException : The value was of an incorrect type for this dictionary."
-                },
-                {
-                    "name": "System.Collections.Concurrent.Tests.ConcurrentDictionaryTests.TestAddNullValue_IDictionary_ValueType_null_add",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentException)\\r\\nActual:   typeof(System.NullReferenceException): Object reference not set to an instance of an object."
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Collections.Immutable.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Collections.Immutable.Tests.ImmutableArrayTest.CreateRangeSliceWithSelector",
-                    "reason": "System.IndexOutOfRangeException System.IndexOutOfRangeException : Index was outside the bounds of the array."
-                },
-                {
-                    "name": "System.Collections.Immutable.Tests.ImmutableArrayTest.CreateRangeWithSelector",
-                    "reason": "System.IndexOutOfRangeException System.IndexOutOfRangeException : Index was outside the bounds of the array."
-                },
-                {
-                    "name": "System.Collections.Immutable.Tests.ImmutableArrayTest.CreateRangeWithSelectorAndArgument",
-                    "reason": "System.IndexOutOfRangeException System.IndexOutOfRangeException : Index was outside the bounds of the array."
-                },
-                {
-                    "name": "System.Collections.Immutable.Tests.ImmutableArrayTest.CreateRangeSliceWithSelectorAndArgument",
-                    "reason": "System.IndexOutOfRangeException System.IndexOutOfRangeException : Index was outside the bounds of the array."
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.ComponentModel.TypeConverter.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.ComponentModel.ToolboxItemAttributeTests.Ctor_NullToolboxItemTypeName_ThrowsArgumentNullException",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentNullException)\\r\\nActual:   typeof(System.NullReferenceException): Object reference not set to an instance of an object."
-                },
-                {
-                    "name": "System.ComponentModel.Tests.EditorAttributeTests.Ctor_NullEditorTypeName_ThrowsArgumentNullException",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentNullException)\\r\\nActual:   typeof(System.NullReferenceException): Object reference not set to an instance of an object."
-                },
-                {
-                    "name": "System.ComponentModel.Tests.DesignerAttributeTests.Ctor_NullDesignerTypeName_ThrowsArgumentNullExceptionException",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentNullException)\\r\\nActual:   typeof(System.NullReferenceException): Object reference not set to an instance of an object."
-                }
-            ]
-        }
-    },
-    {
         "name": "System.Console.Tests",
-        "enabled": true,
+        "enabled": true, 
         "exclusions": {
             "namespaces": null,
             "classes": null,
             "methods": [
                 {
-                    "name": "WindowAndCursorProps.WindowLeftTop_Windows",
-                    "reason": "Assert.Throws() Failure\r\nExpected: typeof(System.IO.IOException)\r\nActual:   (No exception was thrown)"
-                },
-                {
-                    "name": "WindowAndCursorProps.WindowWidth_WindowHeight_InvalidSize",
-                    "reason": "Assert.Throws() Failure\r\nExpected: typeof(System.IO.IOException)\r\nActual:   typeof(System.ArgumentOutOfRangeException): Positive number required.\r\nParameter name: width\r\nActual value was 0."
-                },
-                {
                     "name": "WindowAndCursorProps.SetWindowPosition_GetWindowPosition_ReturnsExpected",
                     "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\n          ↓ (pos 0)\\r\\nExpected: top\\r\\nActual:   left\\r\\n          ↑ (pos 0)"
                 },
                 {
                     "name": "WindowAndCursorProps.GetCursorPosition",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: 2886\\r\\nActual:   2887"
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Data.DataSetExtensions.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Data.Tests.DataRowComparerTests.Equals_NullStringValueInStringArray_CanBeCompared",
-                    "reason": "System.NullReferenceException : Object reference not set to an instance of an object."
+                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: 12\\r\\nActual:   13"
                 }
             ]
         }
     },
     {
         "name": "System.Drawing.Common.Tests",
-        "enabled": true,
+        "enabled": true, 
         "exclusions": {
             "namespaces": null,
             "classes": null,
                 },
                 {
                     "name": "System.Drawing.Tests.Graphics_DrawBezierTests.DrawBezier_PointFs",
-                    "reason": "Intermittent Failure"
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.IO.Compression.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.IO.Compression.GzipStreamUnitTests.ConcatenatedGzipStreams",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: Stream 2\\r\\nActual:   (null)"
-                },
-                {
-                    "name": "System.IO.Compression.GzipStreamUnitTests.ManyConcatenatedGzipStreams",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: 1000\\r\\nActual:   1"
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.IO.FileSystem.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.IO.Tests.Enumeration.RemovedDirectoryTests.RemoveDirectoryBeforeHandleCreationAndReplaceWithFile",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.Enumeration.RemovedDirectoryTests.RemoveDirectoryBeforeHandleCreation",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.Enumeration.ExampleTests.TestCountFiles",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.Enumeration.ExampleTests.TestGetFilesWithExtensions",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.Enumeration.ExampleTests.TestCountFileBytes",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.Enumeration.ExampleTests.GetFileNamesEnumerable",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.DirectoryInfo_CreateSubDirectory.ValidPathWithoutTrailingSlash",
-                    "reason": "System.ArgumentException System.ArgumentException : The directory specified, 'oq3eklx3.oeu', is not a subdirectory of 'C:\\\\Users\\\\anandono\\\\AppData\\\\Local\\\\Temp\\\\DirectoryInfo_CreateSubDirectory_vv4tbdki.2q5\\\\ValidPathWithoutTrailingSlash_142_98959e38\\\\'.\\r\\nParameter name: path"
-                },
-                {
-                    "name": "System.IO.Tests.DirectoryInfo_CreateSubDirectory.ValidPathWithTrailingSlash",
-                    "reason": "System.ArgumentException System.ArgumentException : The directory specified, '3tw22dam.r5w\\\\', is not a subdirectory of 'C:\\\\Users\\\\anandono\\\\AppData\\\\Local\\\\Temp\\\\DirectoryInfo_CreateSubDirectory_xiv2oluq.bps\\\\ValidPathWithTrailingSlash_121_6652a2bc\\\\'.\\r\\nParameter name: path"
-                },
-                {
-                    "name": "System.IO.Tests.Enumeration.TrimmedPaths.TrimmedPathsText_Windows",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.Enumeration.TrimmedPaths.TrimmedPathsCopyTo_Windows",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.Enumeration.TrimmedPaths.TrimmedPathsOpen_Windows",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.Enumeration.TrimmedPaths.TrimmedPathsMoveTo_Windows",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String, System.String)'."
+                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: Byte[] [208, 0, 8, 33, 6, ...]\\r\\nActual:   Byte[] [153, 27, 131, 228, 197, ...]"
                 },
                 {
-                    "name": "System.IO.Tests.Enumeration.TrimmedPaths.TrimmedPathsReplace_Windows",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
+                    "name": "System.Drawing.Tests.Graphics_DrawLineTests.DrawLines_PointFs",
+                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: Byte[] [142, 194, 251, 180, 222, ...]\\r\\nActual:   Byte[] [212, 29, 140, 217, 143, ...]"
                 }
             ]
         }
     },
     {
-        "name": "System.Linq.Expressions.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Linq.Expressions.Tests.GetDelegateTypeTests.CantBeFunc",
-                    "reason": "System.TypeLoadException System.TypeLoadException : The generic type 'System.Func`1' was used with an invalid instantiation in assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'."
-                },
-                {
-                    "name": "System.Linq.Expressions.Tests.GetDelegateTypeTests.CantBeAction",
-                    "reason": "System.TypeLoadException System.TypeLoadException : The generic type 'System.Action`1' was used with an invalid instantiation in assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'."
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Net.Http.Functional.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.GetAsync_ExpectContinueTrue_NoContent_StillSendsHeader",
-                    "reason": "System.Net.Http.HttpRequestException System.Net.Http.HttpRequestException : Response status code does not indicate success: 100 (Continue)."
-                },
-                {
-                    "name": "System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpProtocolTests_Dribble.CustomMethod_SentUppercasedIfKnown",
-                    "reason": "Xunit.Sdk.StartsWithException Assert.StartsWith() Failure:\\r\\nExpected: GET \\r\\nActual:   get ..."
-                },
-                {
-                    "name": "System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpProtocolTests.CustomMethod_SentUppercasedIfKnown_Additional",
-                    "reason": "Xunit.Sdk.StartsWithException Assert.StartsWith() Failure:\\r\\nExpected: DELETE \\r\\nActual:   delete ..."
-                },
-                {
-                    "name": "System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpProtocolTests.CustomMethod_SentUppercasedIfKnown",
-                    "reason": "Xunit.Sdk.StartsWithException Assert.StartsWith() Failure:\\r\\nExpected: GET \\r\\nActual:   get ..."
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Net.Primitives.Functional.Tests",
-        "enabled": true,
-        "exclusions": {
+        "name": "System.Security.Cryptography.X509Certificates.Tests",
+        "enabled": true, "exclusions": {
             "namespaces": null,
             "classes": null,
             "methods": [
                 {
-                    "name": "System.Net.Primitives.Functional.Tests.CookieCollectionTest.Remove_NonExistantCookie_ReturnsFalse",
-                    "reason": "System.EntryPointNotFoundException System.EntryPointNotFoundException : Entry point was not found."
-                },
-                {
-                    "name": "System.Net.Primitives.Functional.Tests.CookieCollectionTest.Contains_Success",
-                    "reason": "System.EntryPointNotFoundException System.EntryPointNotFoundException : Entry point was not found."
-                },
-                {
-                    "name": "System.Net.Primitives.Functional.Tests.CookieCollectionTest.Remove_Success",
-                    "reason": "System.EntryPointNotFoundException System.EntryPointNotFoundException : Entry point was not found."
-                },
-                {
-                    "name": "System.Net.Primitives.Functional.Tests.CookieCollectionTest.Clear_Success",
-                    "reason": "System.EntryPointNotFoundException System.EntryPointNotFoundException : Entry point was not found."
+                    "name": "System.Security.Cryptography.X509Certificates.Tests.X509StoreTests.Constructor_DefaultStoreName",
+                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\n           ↓ (pos 1)\\r\\nExpected: My\\r\\nActual:   MY\\r\\n           ↑ (pos 1)"
                 }
             ]
         }
     },
-
     {
-        "name": "System.Net.Security.Tests",
-        "enabled": true,
+        "name": "System.Data.SqlClient.ManualTesting.Tests",
+        "enabled": false,
         "exclusions": {
             "namespaces": null,
             "classes": null,
-            "methods": [
-                {
-                    "name": "System.Net.Security.Tests.SslStreamCredentialCacheTest.SslStream_SameCertUsedForClientAndServer_Ok",
-                    "reason": "Unreliable"
-                }
-            ]
+            "methods": null
         }
     },
     {
-        "name": "System.Net.Security.Unit.Tests",
+        "name": "System.Data.SqlClient.Stress.Tests",
         "enabled": false,
         "exclusions": {
             "namespaces": null,
         }
     },
     {
-        "name": "System.Net.WebSockets.Tests",
-        "enabled": true,
+        "name": "System.Data.SqlClient.Tests",
+        "enabled": false,
         "exclusions": {
             "namespaces": null,
             "classes": null,
-            "methods": [
-                {
-                    "name": "System.Net.WebSockets.Tests.WebSocketTests.ReceiveAsync_ServerSplitHeader_ValidDataReceived",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: 84\\r\\nActual:   0"
-                }
-            ]
+            "methods": null
         }
     },
     {
-        "name": "System.Net.WebSockets.WebSocketProtocol.Tests",
-        "enabled": true,
+        "name": "System.Threading.Tests",
+        "enabled": true, 
         "exclusions": {
             "namespaces": null,
             "classes": null,
             "methods": [
                 {
-                    "name": "System.Net.WebSockets.Tests.WebSocketProtocolCreateTests.ReceiveAsync_ServerSplitHeader_ValidDataReceived",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: 84\\r\\nActual:   0"
+                    "name": "System.Threading.Tests.EventWaitHandleTests.Ctor_InvalidMode",
+                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: (null)\\r\\nActual:   mode"
                 }
             ]
         }
     },
     {
-        "name": "System.Reflection.Context.Tests",
-        "enabled": true,
+        "name": "System.Xml.Xsl.XslTransformApi.Tests",
+        "enabled": true, 
         "exclusions": {
             "namespaces": null,
             "classes": null,
             "methods": [
                 {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.Invoke_NullObject_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.GetCustomAttributes_NoType_Test",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.GetCustomAttributes_WithType_Test",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.Invoke_NotEmptyParameter_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.ProjectionTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.GetCustomAttributesDataTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.IsDefinedTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.Invoke_NullParameters_Success",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.Invoke_EmptyParameters_Success",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertyGetter_Tests.Invoke_WrongObject_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.SetValue_HasSetter_Success",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.Ctor_NullPropertyName_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.ReflectedTypeTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.AttributesTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetCustomAttributes_NoType_Test",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.CanReadTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.Ctor_NullPropertyType_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.ModuleTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.ToStringTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetAccessorsTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetConstantValueTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetHashCodeTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetOptionalCustomModifiersTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetRawConstantValueTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetValue_NoGetter_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.ProjectionTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.SetValue_NoSetter_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.Ctor_WrongPropertyType_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.SetValue_HasSetterWithIndex_Success",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetCustomAttributesDataTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetRequiredCustomModifiersTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetValue_HasGetter_Success",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.CanWriteTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.MetadataTokenTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.Ctor_GetterAndSetterNull_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetCustomAttributes_WithType_Test",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.Ctor_EmptyPropertyName_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.GetIndexParametersTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfoTests.IsDefinedTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.IsDefinedTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetTypesTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.ProjectAssemblyTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetTypeTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetCustomAttributesTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetExportedTypesTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetModuleTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetManifestResourceInfoTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.EntryPoint",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetModulesTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetCustomAttributesDataTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetHashCodeTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.EqualsTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetSatelliteAssemblyTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.ManifestModuleTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomAssemblyTests.GetLoadedModulesTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.GetCustomAttributes_NoType_Test",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.MakeGenericMethodTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.Invoke_WrongObject_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.GetGenericMethodDefinitionTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.Invoke_NotSingleParameter_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.IsGenericMethodDefinitionTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.GetMethodImplementationFlagsTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.GetBaseDefinition",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.MethodHandleTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.ProjectionTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.Invoke_NullParameter_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.ReturnTypeCustomAttributes",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.Invoke_ValidArguments_Success",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.CallingConventionTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.ModuleTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.GetParametersTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.GetCustomAttributesTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.IsGenericMethodTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.Invoke_NullObject_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.IsDefinedTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.GetCustomAttributes_WithType_Test",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.ReturnParameterTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.GetGenericArgumentsTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.ContainsGenericParametersTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.VirtualPropertyInfo_PropertySetter_Tests.GetCustomAttributesDataTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomPropertyInfoTests.GetCustomAttributesDataTest",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomReflectionContextTests.MapType_ParameterAttributes_Success",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomReflectionContextTests.MapType_MemberAttributes_Success",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomReflectionContextTests.MapType_Null_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomReflectionContextTests.MapAssembly_Null_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomReflectionContextTests.Ctor_Null_Throws",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentNullException)\\r\\nActual:   typeof(System.PlatformNotSupportedException): Customized reflection contexts are only supported on .NET Framework."
-                },
-                {
-                    "name": "System.Reflection.Context.Tests.CustomReflectionContextTests.MapType_Interface_Throws",
-                    "reason": "System.PlatformNotSupportedException System.PlatformNotSupportedException : Customized reflection contexts are only supported on .NET Framework."
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Runtime.Extensions.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.IO.Tests.PathTests_Join.JoinTwoPaths",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String)'."
-                },
-                {
-                    "name": "System.IO.Tests.PathTests_Join.JoinThreePaths",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'System.String System.IO.Path.Join(System.String, System.String, System.String)'."
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Runtime.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Tests.DecimalTests.GetHashCode",
-                    "reason": "Xunit.Sdk.XunitException Decimal 3 has multiple hash codes: 1074266112 (3) and -1074266097 (3.000000000000000000000000000)"
-                },
-                {
-                    "name": "System.Runtime.CompilerServices.Tests.CallerArgumentExpressionAttributeTests.ArgumentToCallerArgumentExpressionSetsParameterNameProperty",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Runtime.CompilerServices.CallerArgumentExpressionAttribute' from assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Tests.ArrayTests.Copy",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: Object[,] [1, 2, 3, 4, 5, ...]\\r\\nActual:   Object[,] [1, 2, 3, 4, 5, ...]"
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Security.Cryptography.Pkcs.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.ProcessResponse_Symantec_NoCerts_WithNonce",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.NegativeNonceIsMadePositive",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.BuildFromSignerInfo",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.BuildExpectedRequest_FromHashAndName",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.NonceLeadingZerosIgnored",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.BuildExpectedRequest_FromData",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.NoncePaddingZerosIgnored",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.BuildFromNullSignerInfo",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentNullException)\\r\\nActual:   typeof(System.TypeLoadException): Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.TryDecode_WithExtensions",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.BuildExpectedRequest_FromHashAndOid",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.ProcessResponse_FreeTsa_WithCerts_NoNonce",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.BuildWithAllOptions",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampRequestTests.EmptyNonce",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.EnsureExtraCertsAdded",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Unknown algorithm '1.2.840.10040.4.3'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.SignCmsUsingECDsaCertWithNotMatchingKeyThrows",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.Security.Cryptography.CryptographicException)\\r\\nActual:   (No exception was thrown)"
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.CheckSignedEncrypted_IssuerSerial_FromNetFx",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Unable to set field EncapContentInfo on type System.Security.Cryptography.Pkcs.Asn1.SignedDataAsn.\\r\\n---- System.Security.Cryptography.CryptographicException : Unable to set field Content on type System.Security.Cryptography.Pkcs.Asn1.EncapsulatedContentInfoAsn.\\r\\n-------- System.Security.Cryptography.CryptographicException : ASN1 corrupted data."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.AddFirstSigner_DSA",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Could not determine signature algorithm for the signer certificate."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.CounterSignCmsUsingExplicitDSAKeyForFirstSignerAndECDsaForCounterSignature",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Could not determine signature algorithm for the signer certificate."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.CounterSignCmsUsingExplicitRSAKeyForFirstSignerAndDSAForCounterSignature",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Could not determine signature algorithm for the signer certificate."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.SignEnveloped",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\nExpected: 2\\r\\nActual:   0"
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.SignIdentifiedContent_BadOid",
-                    "reason": "System.ArgumentNullException System.ArgumentNullException : Value cannot be null.\\r\\nParameter name: oidValue"
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.SignCmsUsingExplicitDSAKey",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Could not determine signature algorithm for the signer certificate."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignedCmsTests.SignerInfoCollection_Indexer_MinusOne",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentOutOfRangeException)\\r\\nActual:   typeof(System.IndexOutOfRangeException): Index was outside the bounds of the array."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingExplicitPrivateKey.DecryptEnvelopedEmptyOctetStringWithIndefiniteLength",
-                    "reason": "Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException : Unexpected cryptographic message encoding."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingExplicitPrivateKey.DecryptEnvelopedDataWithNonPkcs7Oid",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\n          ↓ (pos 0)\\r\\nExpected: 3003010203\\r\\nActual:   010203\\r\\n          ↑ (pos 0)"
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingExplicitPrivateKey.DecryptEnvelopedOctetStringWithExtraData",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\n          ↓ (pos 0)\\r\\nExpected: 300102\\r\\nActual:   02\\r\\n          ↑ (pos 0)"
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingExplicitPrivateKey.DecryptEnvelopedEmptyArray",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\n          ↓ (pos 0)\\r\\nExpected: 3000\\r\\nActual:   \\r\\n          ↑ (pos 0)"
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingExplicitPrivateKey.DecryptEnvelopedOctetStringWithDefiniteLength",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\n          ↓ (pos 0)\\r\\nExpected: 3003010203\\r\\nActual:   010203\\r\\n          ↑ (pos 0)"
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingExplicitPrivateKey.DecryptEnvelopedOctetStringWithIndefiniteLength",
-                    "reason": "Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException : Unexpected cryptographic message encoding."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingExplicitPrivateKey.DecryptEnvelopedEmptyOctetString",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\n          ↓ (pos 0)\\r\\nExpected: 3000\\r\\nActual:   \\r\\n          ↑ (pos 0)"
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingExplicitPrivateKey.DecryptEnvelopedOctetStringWithInefficientlyEncodedLength",
-                    "reason": "Xunit.Sdk.EqualException Assert.Equal() Failure\\r\\n          ↓ (pos 0)\\r\\nExpected: 3003010203\\r\\nActual:   010203\\r\\n          ↑ (pos 0)"
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignerInfoTests.SignerInfo_AddRemoveUnsignedAttributes_JoinCounterSignaturesAttributesIntoOne",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Could not determine signature algorithm for the signer certificate."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignerInfoTests.SignerInfo_AddUnsignedAttribute_Adds",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignerInfoTests.EnsureExtraCertsAdded",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Unknown algorithm '1.2.840.10040.4.3'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignerInfoTests.AddCounterSigner_DSA",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Could not determine signature algorithm for the signer certificate."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignerInfoTests.SignerInfo_RemoveUnsignedAttributes_MultipleAttributeValues",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.SignerInfoTests.RemoveCounterSignature_EncodedInSingleAttribute",
-                    "reason": "System.Security.Cryptography.CryptographicException System.Security.Cryptography.CryptographicException : Unknown algorithm '1.2.840.10040.4.3'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.TryDecode_Fails_Empty",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.NoEkuExtension",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.CertHashMismatchV2",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.MatchV2",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.TimestampTooOld",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.TryDecode_Fails_SignedCmsOfData",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.TwoEkuExtensions",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.TryDecode_Fails_MalformedToken",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.CertMismatchIssuerAndSerialV2",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.CertHashMismatchV1",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.TimestampTooNew",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.MatchV1",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.CertMismatchIssuerAndSerialV1",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.CertMismatchV1OrV2",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.CertMatchV1AndV2",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.TryDecode_Fails_EnvelopedCms",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.NonCriticalEkuExtension",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.ParseDocument_ExcessData",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.NoTsaEku",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenTests.ParseDocument",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampToken' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingCertWithPrivateKey.DecryptEnvelopedOctetStringWithIndefiniteLength",
-                    "reason": "Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException : Unexpected cryptographic message encoding."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests.DecryptTestsUsingCertWithPrivateKey.DecryptEnvelopedEmptyOctetStringWithIndefiniteLength",
-                    "reason": "Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException : Unexpected cryptographic message encoding."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.BuilderCtor_TsaNameOptional",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.BuilderCtor_IsOrdering_Roundtrips",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.BuilderCtor_HashAlgorithmIdRequired",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentNullException)\\r\\nActual:   typeof(System.TypeLoadException): Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.Accuracy_Bounds_ParsesAsExpected",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.NegativeAccuracyThrows",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentOutOfRangeException)\\r\\nActual:   typeof(System.TypeLoadException): Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.ExtensionsRoundtrips",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.AccuracyRoundtrips",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.CreateFromValue",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.BuilderCtor_AccuracyOptional",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.TryDecode_Invalid",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.CreateFromParameters",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.BuilderCtor_Timestamp_KeepsSubSeconds",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.TryDecode_LongerThanNeeded",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.BuilderCtor_PolicyIdRequired",
-                    "reason": "Xunit.Sdk.ThrowsException Assert.Throws() Failure\\r\\nExpected: typeof(System.ArgumentNullException)\\r\\nActual:   typeof(System.TypeLoadException): Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                },
-                {
-                    "name": "System.Security.Cryptography.Pkcs.Tests.TimestampTokenInfoTests.TsaName_SameDataSecondInvocation",
-                    "reason": "System.TypeLoadException System.TypeLoadException : Could not load type 'System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo' from assembly 'System.Security.Cryptography.Pkcs, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Security.Cryptography.Xml.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Security.Cryptography.Xml.Tests.EncryptionMethodTests.KeySize_SetNegativeValue_ThrowsArgumentOutOfRangeException",
-                    "reason": "System.MissingMethodException System.MissingMethodException : Method not found: 'Void System.AssertExtensions.Throws(System.String, System.String, System.Func`1<System.Object>)'."
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Data.SqlClient.ManualTesting.Tests",
-        "enabled": false,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": null
-        }
-    },
-    {
-        "name": "System.Data.SqlClient.Stress.Tests",
-        "enabled": false,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": null
-        }
-    },
-    {
-        "name": "System.Data.SqlClient.Tests",
-        "enabled": false,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": null
-        }
-    },
-    {
-        "name": "System.Text.Encoding.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Text.Tests.DecoderFallbackTests.TestDecoderFallbackIndex",
-                    "reason": "System.Text.DecoderFallbackException System.Text.DecoderFallbackException : Encountered a negative index during Utf8 decoding fallback "
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Text.RegularExpressions.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Text.RegularExpressions.Tests.GroupCollectionReadOnlyDictionaryTests.IReadOnlyDictionary_GetEnumerator",
-                    "reason": "System.EntryPointNotFoundException System.EntryPointNotFoundException : Entry point was not found."
-                },
-                {
-                    "name": "System.Text.RegularExpressions.Tests.GroupCollectionReadOnlyDictionaryTests.GetEnumerator_Invalid",
-                    "reason": "System.EntryPointNotFoundException System.EntryPointNotFoundException : Entry point was not found."
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Threading.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Threading.Tests.EventWaitHandleTests.OpenExisting_Windows",
-                    "reason": "System.ArgumentException System.ArgumentException : The name 'fac694268eb248e9990777825b5aaab9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' can be no more than 260 characters in length.\\r\\nParameter name: name"
-                },
-                {
-                    "name": "System.Threading.Tests.EventWaitHandleTests.Ctor_ValidNames",
-                    "reason": "System.ArgumentException System.ArgumentException : The name '8503e07c28f04a8e8ce1c4604f6adbb2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' can be no more than 260 characters in length.\\r\\nParameter name: name"
-                },
-                {
-                    "name": "System.Threading.Tests.MutexTests.Ctor_ValidName",
-                    "reason": "System.ArgumentException System.ArgumentException : The name '998ce9564d1745d8b901082f7ad17183aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' can be no more than 260 characters in length.\\r\\nParameter name: name"
-                },
-                {
-                    "name": "System.Threading.Tests.MutexTests.OpenExisting",
-                    "reason": "System.ArgumentException System.ArgumentException : The name '9cc4ad4ac10046cdb05f91bf0f81ad13aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' can be no more than 260 characters in length.\\r\\nParameter name: name"
-                },
-                {
-                    "name": "System.Threading.Tests.SemaphoreTests.OpenExisting_SameAsOriginal_Windows",
-                    "reason": "System.ArgumentException System.ArgumentException : The name '03ded9d0ccd74eefa101daae32e80ef8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' can be no more than 260 characters in length.\\r\\nParameter name: name"
-                },
-                {
-                    "name": "System.Threading.Tests.SemaphoreTests.Ctor_ValidName_Windows",
-                    "reason": "System.ArgumentException System.ArgumentException : The name '27095bdc00264a159609fd12b7052b03aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' can be no more than 260 characters in length.\\r\\nParameter name: name"
-                },
-                {
-                    "name": "System.Threading.Tests.EventWaitHandleTests.Ctor_InvalidMode",
-                    "reason": "Assert.Equal() Failure Expected: (null) Actual: mode"
-                }
-            ]
-        }
-    },
-    {
-        "name": "System.Xml.Xsl.XslTransformApi.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Xml.Tests.CXmlResolverTest.TC_AbsolutePath_Transform",
-                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
+                    "name": "System.Xml.Tests.CXmlResolverTest.TC_AbsolutePath_Transform",
+                    "reason": "Xunit.Sdk.TrueException Assert.True() Failure\\r\\nExpected: True\\r\\nActual:   False"
                 },
                 {
                     "name": "System.Xml.Tests.CTransformResolverTest.TC_AbsolutePath_Transform",
                 }
             ]
         }
-    },
-    {
-        "name": "System.Security.Cryptography.X509Certificates.Tests",
-        "enabled": true,
-        "exclusions": {
-            "namespaces": null,
-            "classes": null,
-            "methods": [
-                {
-                    "name": "System.Security.Cryptography.X509Certificates.Tests.X509StoreTests.Constructor_DefaultStoreName",
-                    "reason": "Expected: My\r\nActual: MY\r\n"
-                }
-            ]
-        }
     }
 ]
index 1772f8c..8e3b7cc 100644 (file)
     <!-- The following are ARM64_altjit crossgen failures. For x64_arm64_altjit buildArm==x64. -->
 
     <ItemGroup Condition="'$(XunitTestBinBase)' != '' and '$(BuildArch)' == 'x64'">
-        <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JitBlue\DevDiv_590772\DevDiv_590772\DevDiv_590772.cmd">
-            <Issue>17968</Issue>
-        </ExcludeList>
-        <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JitBlue\DevDiv_605447\DevDiv_605447\DevDiv_605447.cmd">
-            <Issue>17966</Issue>
-        </ExcludeList>
         <ExcludeList Include="$(XunitTestBinBase)\JIT\Regression\JitBlue\DevDiv_590771\DevDiv_590771\DevDiv_590771.cmd">
             <Issue>17967</Issue>
         </ExcludeList>
index 862fc65..5c79770 100644 (file)
@@ -81,7 +81,7 @@ if errorlevel 1 goto Fail
 
 REM Get downloaded dll path
 echo Locating coredistools.dll
-FOR /F "delims=" %%i IN ('dir %__PackageDir%\coredistools.dll /b/s ^| findstr /R "win[0-9]*-%__Arch%"') DO set __LibPath=%%i
+FOR /F "delims=" %%i IN ('dir %__PackageDir%\coredistools.dll /b/s ^| findstr /R "win-%__Arch%"') DO set __LibPath=%%i
 echo CoreDisTools library path: %__LibPath%
 if not exist "%__LibPath%" (
     echo Failed to locate the downloaded library: %__LibPath%
index 5863b19..d919efc 100644 (file)
@@ -4,8 +4,8 @@
   <PropertyGroup>
       <RestoreOutputPath>$(SourceDir)Common\CoreFX\obj</RestoreOutputPath>
       <Language>C#</Language>
-      <NugetTargetMoniker>.NETCoreApp,Version=v2.0</NugetTargetMoniker>
-      <NugetTargetMonikerShort>netcoreapp2.0</NugetTargetMonikerShort>
+      <NugetTargetMoniker>.NETCoreApp,Version=v3.0</NugetTargetMoniker>
+      <TargetFramework>netcoreapp3.0</TargetFramework>
       <ContainsPackageReferences>true</ContainsPackageReferences>
       <CLRTestKind>SharedLibrary</CLRTestKind>
       <IsTestProject>false</IsTestProject>
@@ -15,6 +15,7 @@
       <!-- Xunit Abstractions is differently versioned then the rest of XUnit -->
       <XUnitAbstractionsVersion>2.0.1</XUnitAbstractionsVersion>
       <CoreFXXUnitPackageVersion>2.2.0-beta2-build3300</CoreFXXUnitPackageVersion>
+      <MicrosoftDiagnosticsTracingTraceVentVersion>2.0.19</MicrosoftDiagnosticsTracingTraceVentVersion>
   </PropertyGroup>
 
   <!-- Switch RuntimeIdentifier according to currently running OSGroup -->
@@ -86,6 +87,9 @@
     <PackageReference Include="System.Data.SqlClient">
       <Version>$(MicrosoftPrivateCoreFxNETCoreAppPackageVersion)</Version>
     </PackageReference>
+    <PackageReference Include="System.Diagnostics.PerformanceCounter">
+      <Version>$(MicrosoftPrivateCoreFxNETCoreAppPackageVersion)</Version>
+    </PackageReference>
     <PackageReference Include="System.DirectoryServices">
       <Version>$(MicrosoftPrivateCoreFxNETCoreAppPackageVersion)</Version>
     </PackageReference>
     <PackageReference Include="Microsoft.Win32.SystemEvents">
       <Version>$(MicrosoftPrivateCoreFxNETCoreAppPackageVersion)</Version>
     </PackageReference>
+    <PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent">
+      <Version>$(MicrosoftDiagnosticsTracingTraceVentVersion)</Version>
+    </PackageReference>
   </ItemGroup>
-  <PropertyGroup>
-    <TargetFramework>netcoreapp2.2</TargetFramework>
-  </PropertyGroup>
   <ItemGroup>
     <PackageToInclude Include="@(PackageReference -> '%(Identity)' )"/>
   </ItemGroup>
index e33ee1e..410c795 100644 (file)
@@ -18,7 +18,7 @@
     <TargetFramework>netcoreapp2.0</TargetFramework>
     <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
     <PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
-    <RuntimeIdentifiers>win7-x64;ubuntu.14.04-x64;osx.10.10-x64;win7-x86;ubuntu.14.04-x86;osx.10.10-x86</RuntimeIdentifiers>
+    <RuntimeIdentifiers>win-x64;ubuntu.14.04-x64;osx.10.10-x64;win-x86;ubuntu.14.04-x86;osx.10.10-x86</RuntimeIdentifiers>
     <ContainsPackageReferences>true</ContainsPackageReferences>
     <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
   </PropertyGroup>
index 2c59dfd..ecaae0d 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractByte1()
         {
             var test = new SimpleUnaryOpTest__ExtractByte1();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 068e812..cd8805e 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractByte20()
         {
             var test = new SimpleUnaryOpTest__ExtractByte20();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 4f39a52..203f5fd 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractByte52()
         {
             var test = new SimpleUnaryOpTest__ExtractByte52();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 133d65a..ea140da 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt321()
         {
             var test = new SimpleUnaryOpTest__ExtractInt321();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index bd79d92..0706206 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt3222()
         {
             var test = new SimpleUnaryOpTest__ExtractInt3222();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 0e42ec7..be6f8a8 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt326()
         {
             var test = new SimpleUnaryOpTest__ExtractInt326();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 2213721..8f7518a 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt641()
         {
             var test = new SimpleUnaryOpTest__ExtractInt641();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 24e7207..5566bec 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt6419()
         {
             var test = new SimpleUnaryOpTest__ExtractInt6419();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index fb89cd0..e0cdece 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt643()
         {
             var test = new SimpleUnaryOpTest__ExtractInt643();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 717749c..aa2b92f 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt161()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt161();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index b68ab35..8b09d37 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt1611()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt1611();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 9ece246..af88227 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt1627()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt1627();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 846efb1..5d7a360 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt321()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt321();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 7251ef7..5199c95 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt3222()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt3222();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 6546a7e..0a9cf39 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt326()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt326();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 9f6315a..8f36015 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt641()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt641();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index d3d90d8..817b73f 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt6419()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt6419();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 8b3f3cf..21480f0 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt643()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt643();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index d596cfc..dc24dd4 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertByte1()
         {
             var test = new SimpleUnaryOpTest__InsertByte1();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 73ccb9d..9676713 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertByte20()
         {
             var test = new SimpleUnaryOpTest__InsertByte20();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 218f984..16b7cb3 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertByte52()
         {
             var test = new SimpleUnaryOpTest__InsertByte52();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 1899ec7..6db867f 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt161()
         {
             var test = new SimpleUnaryOpTest__InsertInt161();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int16, Int16>(_data, new Int16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int16) != typeof(long)) && (typeof(Int16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 7e3049b..e64b977 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt1611()
         {
             var test = new SimpleUnaryOpTest__InsertInt1611();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int16, Int16>(_data, new Int16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int16) != typeof(long)) && (typeof(Int16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 373db0f..30f76ac 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt1627()
         {
             var test = new SimpleUnaryOpTest__InsertInt1627();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int16, Int16>(_data, new Int16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int16) != typeof(long)) && (typeof(Int16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 0e2d1eb..fd4c149 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt321()
         {
             var test = new SimpleUnaryOpTest__InsertInt321();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 9740754..a988031 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt3222()
         {
             var test = new SimpleUnaryOpTest__InsertInt3222();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 2b1da87..d37cf36 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt326()
         {
             var test = new SimpleUnaryOpTest__InsertInt326();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index f17ff1f..a94f30b 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt641()
         {
             var test = new SimpleUnaryOpTest__InsertInt641();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 012f964..501ebd5 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt6419()
         {
             var test = new SimpleUnaryOpTest__InsertInt6419();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 2447132..3b842c4 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt643()
         {
             var test = new SimpleUnaryOpTest__InsertInt643();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index ca6d9f5..e9f9f4b 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertSByte1()
         {
             var test = new SimpleUnaryOpTest__InsertSByte1();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<SByte, SByte>(_data, new SByte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(SByte) != typeof(long)) && (typeof(SByte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 917aba5..d95d63f 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertSByte20()
         {
             var test = new SimpleUnaryOpTest__InsertSByte20();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<SByte, SByte>(_data, new SByte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(SByte) != typeof(long)) && (typeof(SByte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index cbbaa73..bdbea54 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertSByte52()
         {
             var test = new SimpleUnaryOpTest__InsertSByte52();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<SByte, SByte>(_data, new SByte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(SByte) != typeof(long)) && (typeof(SByte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index b17dbdc..bd2cfe2 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt161()
         {
             var test = new SimpleUnaryOpTest__InsertUInt161();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 43f4a5a..8bbea9b 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt1611()
         {
             var test = new SimpleUnaryOpTest__InsertUInt1611();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index cff1f45..50a583e 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt1627()
         {
             var test = new SimpleUnaryOpTest__InsertUInt1627();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 608bede..391a2fb 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt321()
         {
             var test = new SimpleUnaryOpTest__InsertUInt321();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index e3609e8..878c462 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt3222()
         {
             var test = new SimpleUnaryOpTest__InsertUInt3222();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index ffd0035..2c3947b 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt326()
         {
             var test = new SimpleUnaryOpTest__InsertUInt326();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 8ec1dd8..efc9265 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt641()
         {
             var test = new SimpleUnaryOpTest__InsertUInt641();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index f60e347..2601ae0 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt6419()
         {
             var test = new SimpleUnaryOpTest__InsertUInt6419();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index fd815ca..122c687 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt643()
         {
             var test = new SimpleUnaryOpTest__InsertUInt643();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Avx.IsSupported;
+        public bool IsSupported => Avx.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 2a493e0..cb1ca41 100644 (file)
@@ -24,7 +24,7 @@ namespace IntelHardwareIntrinsicTest
             {
                 using (TestTable<float, uint> floatTable = new TestTable<float, uint>(new float[8] { 1, -5, 100, 0, 1, 2, 3, 4 }, new uint[8] { uint.MaxValue, uint.MaxValue, 0, 0, uint.MaxValue, uint.MaxValue, 0, 0 }, new float[8]))
                 {
-                    Vector256<float> vf = Avx.MaskLoad((float*)(floatTable.inArrayPtr), Avx.LoadVector256((uint*)(floatTable.maskArrayPtr)));
+                    Vector256<float> vf = Avx.MaskLoad((float*)(floatTable.inArrayPtr), Avx.LoadVector256((float*)(floatTable.maskArrayPtr)));
                     Unsafe.Write(floatTable.outArrayPtr, vf);
 
                     if (!floatTable.CheckResult((x, m, y) => m == uint.MaxValue ? BitConverter.SingleToInt32Bits(x) == BitConverter.SingleToInt32Bits(y) : BitConverter.SingleToInt32Bits(y) == 0))
@@ -41,7 +41,7 @@ namespace IntelHardwareIntrinsicTest
 
                 using (TestTable<double, ulong> doubleTable = new TestTable<double, ulong>(new double[4] { 1, -5, 100, 0}, new ulong[4] { 0, ulong.MaxValue, ulong.MaxValue, 0}, new double[4]))
                 {
-                    Vector256<double> vf = Avx.MaskLoad((double*)(doubleTable.inArrayPtr), Avx.LoadVector256((ulong*)(doubleTable.maskArrayPtr)));
+                    Vector256<double> vf = Avx.MaskLoad((double*)(doubleTable.inArrayPtr), Avx.LoadVector256((double*)(doubleTable.maskArrayPtr)));
                     Unsafe.Write(doubleTable.outArrayPtr, vf);
 
                     if (!doubleTable.CheckResult((x, m, y) =>  m == ulong.MaxValue ? BitConverter.DoubleToInt64Bits(x) == BitConverter.DoubleToInt64Bits(y) : BitConverter.DoubleToInt64Bits(y) == 0))
@@ -58,7 +58,7 @@ namespace IntelHardwareIntrinsicTest
 
                 using (TestTable<float, uint> floatTable = new TestTable<float, uint>(new float[4] { 1, -5, 100, 0 }, new uint[4] { uint.MaxValue, 0, 0, uint.MaxValue }, new float[4]))
                 {
-                    Vector128<float> vf = Avx.MaskLoad((float*)(floatTable.inArrayPtr), Sse2.LoadVector128((uint*)(floatTable.maskArrayPtr)));
+                    Vector128<float> vf = Avx.MaskLoad((float*)(floatTable.inArrayPtr), Sse.LoadVector128((float*)(floatTable.maskArrayPtr)));
                     Unsafe.Write(floatTable.outArrayPtr, vf);
 
                     if (!floatTable.CheckResult((x, m, y) => m == uint.MaxValue ? BitConverter.SingleToInt32Bits(x) == BitConverter.SingleToInt32Bits(y) : BitConverter.SingleToInt32Bits(y) == 0))
@@ -75,7 +75,7 @@ namespace IntelHardwareIntrinsicTest
 
                 using (TestTable<double, ulong> doubleTable = new TestTable<double, ulong>(new double[2] { 1, -5}, new ulong[2] { 0, ulong.MaxValue}, new double[2]))
                 {
-                    Vector128<double> vf = Avx.MaskLoad((double*)(doubleTable.inArrayPtr), Sse2.LoadVector128((ulong*)(doubleTable.maskArrayPtr)));
+                    Vector128<double> vf = Avx.MaskLoad((double*)(doubleTable.inArrayPtr), Sse2.LoadVector128((double*)(doubleTable.maskArrayPtr)));
                     Unsafe.Write(doubleTable.outArrayPtr, vf);
 
                     if (!doubleTable.CheckResult((x, m, y) =>  m == ulong.MaxValue ? BitConverter.DoubleToInt64Bits(x) == BitConverter.DoubleToInt64Bits(y) : BitConverter.DoubleToInt64Bits(y) == 0))
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_r.csproj b/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_r.csproj
new file mode 100644 (file)
index 0000000..1150e2c
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?> 
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">       
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />     
+  <PropertyGroup>      
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>        
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>      
+    <SchemaVersion>2.0</SchemaVersion> 
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>  
+    <OutputType>Exe</OutputType>       
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> 
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>      
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>        
+  </PropertyGroup>     
+  <!-- Default configurations to help VS understand the configurations -->     
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>       
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />   
+  <ItemGroup>  
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">   
+      <Visible>False</Visible> 
+    </CodeAnalysisDependentAssemblyPaths>      
+  </ItemGroup> 
+  <PropertyGroup>      
+    <DebugType>None</DebugType>        
+    <Optimize></Optimize>      
+  </PropertyGroup>     
+  <ItemGroup>  
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />       
+  </ItemGroup> 
+  <ItemGroup>  
+    <Compile Include="MaskLoad.cs" />  
+  </ItemGroup> 
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> 
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>   
+</Project>
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_ro.csproj b/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_ro.csproj
new file mode 100644 (file)
index 0000000..ec56cde
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?> 
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">       
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />     
+  <PropertyGroup>      
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>        
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>      
+    <SchemaVersion>2.0</SchemaVersion> 
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>  
+    <OutputType>Exe</OutputType>       
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> 
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>      
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>        
+  </PropertyGroup>     
+  <!-- Default configurations to help VS understand the configurations -->     
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>       
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />   
+  <ItemGroup>  
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">   
+      <Visible>False</Visible> 
+    </CodeAnalysisDependentAssemblyPaths>      
+  </ItemGroup> 
+  <PropertyGroup>      
+    <DebugType>None</DebugType>        
+    <Optimize>True</Optimize>  
+  </PropertyGroup>     
+  <ItemGroup>  
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />       
+  </ItemGroup> 
+  <ItemGroup>  
+    <Compile Include="MaskLoad.cs" />  
+  </ItemGroup> 
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> 
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>   
+</Project>
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Avx/StaticCast.cs b/tests/src/JIT/HardwareIntrinsics/X86/Avx/StaticCast.cs
new file mode 100644 (file)
index 0000000..df076a8
--- /dev/null
@@ -0,0 +1,127 @@
+// 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.
+//
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics.X86;
+using System.Runtime.Intrinsics;
+
+namespace IntelHardwareIntrinsicTest
+{
+    // that it is intentionally designed to be a struct type that meets 
+    // the generic constraint but is not supported by any intrinsics
+    struct Num
+    {
+        public int a;
+    }
+
+    class Program
+    {
+        const int Pass = 100;
+        const int Fail = 0;
+
+        static unsafe int Main(string[] args)
+        {
+            int testResult = Pass;
+
+            if (Avx.IsSupported)
+            {
+                using (TestTable<float, int> floatTable = new TestTable<float, int>(new float[8] { 1, float.NaN, float.PositiveInfinity, float.NegativeInfinity, float.NegativeInfinity, float.PositiveInfinity, float.NaN, 1 }, new int[8]))
+                {
+                    var vf1 = Unsafe.Read<Vector256<float>>(floatTable.inArrayPtr);
+                    var vf2 = Avx.StaticCast<float, int>(vf1);
+                    Unsafe.Write(floatTable.outArrayPtr, vf2);
+
+                    if (!floatTable.CheckResult((x, y) => BitConverter.SingleToInt32Bits(x) == y))
+                    {
+                        Console.WriteLine("Avx StaticCast failed on float:");
+                        foreach (var item in floatTable.outArray)
+                        {
+                            Console.Write(item + ", ");
+                        }
+                        Console.WriteLine();
+                        testResult = Fail;
+                    }
+
+                    // the successful path is the one that catches the exception, so that does nothing, 
+                    // it is the fall-through path that's the error path
+                    try
+                    {
+                        var v = Avx.StaticCast<float, Num>(vf1);
+                        Unsafe.Write(floatTable.outArrayPtr, v);
+                        Console.WriteLine("Avx StaticCast failed on target type test:");
+                        testResult = Fail;
+                    }
+                    catch (System.NotSupportedException)
+                    {
+                    }
+
+                    // the successful path is the one that catches the exception, so that does nothing, 
+                    // it is the fall-through path that's the error path
+                    try
+                    {
+                        var v = TestSrcType();
+                        Unsafe.Write(floatTable.outArrayPtr, v);
+                        Console.WriteLine("Avx StaticCast failed on source type test:");
+                        testResult = Fail;
+                    }
+                    catch (System.NotSupportedException)
+                    {
+                    }
+                }
+            }
+            
+            return testResult;
+        }
+        
+        [MethodImpl(MethodImplOptions.NoInlining)]
+        static Vector256<int> TestSrcType()
+        {
+            Vector256<Num> v1 = new Vector256<Num>();
+            Vector256<Num> v2 = new Vector256<Num>();
+            return Avx2.Add(Avx.StaticCast<Num, int>(v1), Avx.StaticCast<Num, int>(v2));
+        }
+
+        public unsafe struct TestTable<T, U> : IDisposable where T : struct where U : struct
+        {
+            public T[] inArray;
+            public U[] outArray;
+
+            public void* inArrayPtr => inHandle.AddrOfPinnedObject().ToPointer();
+            public void* outArrayPtr => outHandle.AddrOfPinnedObject().ToPointer();
+
+            GCHandle inHandle;
+            GCHandle outHandle;
+
+            public TestTable(T[] a, U[] b)
+            {
+                this.inArray = a;
+                this.outArray = b;
+
+                inHandle = GCHandle.Alloc(inArray, GCHandleType.Pinned);
+                outHandle = GCHandle.Alloc(outArray, GCHandleType.Pinned);
+            }
+
+            public bool CheckResult(Func<T, U, bool> check)
+            {
+                for (int i = 0; i < inArray.Length; i++)
+                {
+                    if (!check(inArray[i], outArray[i]))
+                    {
+                        return false;
+                    }
+                }
+                return true;
+            }
+
+            public void Dispose()
+            {
+                inHandle.Free();
+                outHandle.Free();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Avx/StaticCast_r.csproj b/tests/src/JIT/HardwareIntrinsics/X86/Avx/StaticCast_r.csproj
new file mode 100644 (file)
index 0000000..55e5f3c
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType>None</DebugType>
+    <Optimize></Optimize>
+  </PropertyGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="StaticCast.cs" />
+  </ItemGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Avx/StaticCast_ro.csproj b/tests/src/JIT/HardwareIntrinsics/X86/Avx/StaticCast_ro.csproj
new file mode 100644 (file)
index 0000000..913ca45
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType>None</DebugType>
+    <Optimize>True</Optimize>
+  </PropertyGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="StaticCast.cs" />
+  </ItemGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
index 71ff744..4fe9832 100644 (file)
@@ -14,6 +14,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
 using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
index 226d847..bbb1906 100644 (file)
@@ -14,6 +14,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
 using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
index ddf47a5..b50d7a8 100644 (file)
@@ -14,6 +14,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
 using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
index e8cdf0f..d5629d5 100644 (file)
@@ -14,6 +14,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
 using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
index 94c92ee..449acbf 100644 (file)
@@ -14,6 +14,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
 using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
index 57f1d2d..1c2c0b3 100644 (file)
@@ -14,6 +14,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
 using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
index 244d788..93778dd 100644 (file)
@@ -14,6 +14,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
 using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
index 76ac558..38cb48a 100644 (file)
@@ -14,6 +14,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
 using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
index 0ac2b50..e1876a1 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void {Method}{RetBaseType}{Imm}()
         {
             var test = new SimpleUnaryOpTest__{Method}{RetBaseType}{Imm}();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<{RetBaseType}, {Op1BaseType}>(_data, new {RetBaseType}[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => {Isa}.IsSupported;
+        public bool IsSupported => {Isa}.IsSupported && (Environment.Is64BitProcess || ((typeof({RetBaseType}) != typeof(long)) && (typeof({RetBaseType}) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 13c621f..81bdf1f 100644 (file)
@@ -297,18 +297,30 @@ private static readonly (string templateFileName, Dictionary<string, string> tem
     ("SimpleUnOpTest.template",      new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Floor",                         ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single",                                                                                                                                                                   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                                                                                                                                                                ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[0]))",                                                                                                                                               ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[i]))"}),
     ("SimpleBinOpTest.template",     new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "FloorScalar",                   ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double",                                                                                                      ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(double)(random.NextDouble())",                        ["NextValueOp2"] = "(double)(random.NextDouble())",                                                                                    ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Floor(right[0]))",                                                                                                                                                  ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i])"}),
     ("SimpleBinOpTest.template",     new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "FloorScalar",                   ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                                      ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(right[0]))",                                                                                                                                                 ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "0",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[0])",                                                                                                                                                              ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Byte",                                                                                                                             ["Data"] = "(byte)2",  ["Imm"] = "1",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(byte)(random.Next(0, byte.MaxValue))",                                                                                                                                                       ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "SByte",                                                                                                                            ["Data"] = "(sbyte)2", ["Imm"] = "1",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)(random.Next(0, sbyte.MaxValue))",                                                                                                                                                     ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int32",                                                                                                                            ["Data"] = "(int)2",   ["Imm"] = "1",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(int)(random.Next(0, int.MaxValue))",                                                                                                                                                         ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt32",                                                                                                                           ["Data"] = "(uint)2",  ["Imm"] = "1",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(uint)(random.Next(0, int.MaxValue))",                                                                                                                                                        ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64",   ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int64",                                                                                                                            ["Data"] = "(long)2",  ["Imm"] = "1",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(long)(random.Next(0, int.MaxValue))",                                                                                                                                                        ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt64",                                                                                                                           ["Data"] = "(ulong)2", ["Imm"] = "1",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(ulong)(random.Next(0, int.MaxValue))",                                                                                                                                                       ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "1",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(0.0f)",                                                                                                                                                                  ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "2",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[0])",                                                                                                                                                              ["ValidateRemainingResults"] = "i == 1 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "4",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[0])",                                                                                                                                                              ["ValidateRemainingResults"] = "i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "8",   ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[0])",                                                                                                                                                              ["ValidateRemainingResults"] = "i == 3 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "16",  ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(left[0])",                                                                                                                                                               ["ValidateRemainingResults"] = "i == 1 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(right[0]) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "32",  ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(left[0])",                                                                                                                                                               ["ValidateRemainingResults"] = "i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(right[0]) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "48",  ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(left[0])",                                                                                                                                                               ["ValidateRemainingResults"] = "i == 3 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(right[0]) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "64",  ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[1])",                                                                                                                                                              ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "128", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[2])",                                                                                                                                                              ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte",    ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Byte",                                                                                                                             ["Data"] = "(byte)2",  ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(byte)(random.Next(0, byte.MaxValue))",                                                                                                                                                       ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "SByte",                                                                                                                            ["Data"] = "(sbyte)2", ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)(random.Next(0, sbyte.MaxValue))",                                                                                                                                                     ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int32",                                                                                                                            ["Data"] = "(int)2",   ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(int)(random.Next(0, int.MaxValue))",                                                                                                                                                         ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt32",                                                                                                                           ["Data"] = "(uint)2",  ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(uint)(random.Next(0, int.MaxValue))",                                                                                                                                                        ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64",   ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int64",                                                                                                                            ["Data"] = "(long)2",  ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(long)(random.Next(0, int.MaxValue))",                                                                                                                                                        ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
     ("InsertScalarTest.template",    new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt64",                                                                                                                           ["Data"] = "(ulong)2", ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(ulong)(random.Next(0, int.MaxValue))",                                                                                                                                                       ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(0.0f)",                                                                                                                                                                  ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
+    ("InsertVector128Test.template", new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse",  ["Method"] = "Insert",                        ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single",                                                                                     ["Imm"] = "192", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())",                         ["NextValueOp2"] = "(float)(random.NextDouble())",                                                                                     ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[3])",                                                                                                                                                              ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}),
     ("SimpleBinOpTest.template",     new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Max",                           ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32",   ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int32",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32",                                                                                                       ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(int)(random.Next(int.MinValue, int.MaxValue))",       ["NextValueOp2"] = "(int)(random.Next(int.MinValue, int.MaxValue))",                                                                   ["ValidateFirstResult"] = "result[0] != Math.Max(left[0], right[0])",                                                                                                                                                                                                           ["ValidateRemainingResults"] = "result[i] != Math.Max(left[i], right[i])"}),
     ("SimpleBinOpTest.template",     new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Max",                           ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte",   ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "SByte",  ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte",                                                                                                       ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", ["NextValueOp2"] = "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))",                                                             ["ValidateFirstResult"] = "result[0] != Math.Max(left[0], right[0])",                                                                                                                                                                                                           ["ValidateRemainingResults"] = "result[i] != Math.Max(left[i], right[i])"}),
     ("SimpleBinOpTest.template",     new Dictionary<string, string> { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Max",                           ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16",  ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16",                                                                                                      ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(ushort)(random.Next(0, ushort.MaxValue))",            ["NextValueOp2"] = "(ushort)(random.Next(0, ushort.MaxValue))",                                                                        ["ValidateFirstResult"] = "result[0] != Math.Max(left[0], right[0])",                                                                                                                                                                                                           ["ValidateRemainingResults"] = "result[i] != Math.Max(left[i], right[i])"}),
index cc330e7..c08700f 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void {Method}{RetBaseType}{Imm}()
         {
             var test = new SimpleUnaryOpTest__{Method}{RetBaseType}{Imm}();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<{RetBaseType}, {Op1BaseType}>(_data, new {RetBaseType}[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => {Isa}.IsSupported;
+        public bool IsSupported => {Isa}.IsSupported && (Environment.Is64BitProcess || ((typeof({RetBaseType}) != typeof(long)) && (typeof({RetBaseType}) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index e95bb2b..401980f 100644 (file)
@@ -14,6 +14,7 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
 using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
index 4683cb8..f3bea8f 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt161()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt161();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse2.IsSupported;
+        public bool IsSupported => Sse2.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index ce9513a..fe45a56 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt16129()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt16129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse2.IsSupported;
+        public bool IsSupported => Sse2.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 0f2f4e6..7523812 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt161()
         {
             var test = new SimpleUnaryOpTest__InsertInt161();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int16, Int16>(_data, new Int16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse2.IsSupported;
+        public bool IsSupported => Sse2.IsSupported && (Environment.Is64BitProcess || ((typeof(Int16) != typeof(long)) && (typeof(Int16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 619d918..2c9d92c 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt16129()
         {
             var test = new SimpleUnaryOpTest__InsertInt16129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int16, Int16>(_data, new Int16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse2.IsSupported;
+        public bool IsSupported => Sse2.IsSupported && (Environment.Is64BitProcess || ((typeof(Int16) != typeof(long)) && (typeof(Int16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 70b29d1..b46b3ab 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt161()
         {
             var test = new SimpleUnaryOpTest__InsertUInt161();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse2.IsSupported;
+        public bool IsSupported => Sse2.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 2c16bc8..719ef7c 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt16129()
         {
             var test = new SimpleUnaryOpTest__InsertUInt16129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt16, UInt16>(_data, new UInt16[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse2.IsSupported;
+        public bool IsSupported => Sse2.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt16) != typeof(long)) && (typeof(UInt16) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index da59ecd..d7e9847 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractByte1()
         {
             var test = new SimpleUnaryOpTest__ExtractByte1();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 8cc0b1c..4f6a93b 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractByte129()
         {
             var test = new SimpleUnaryOpTest__ExtractByte129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 3e78afd..05bb4f0 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt321()
         {
             var test = new SimpleUnaryOpTest__ExtractInt321();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index d8c9565..1b63c5d 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt32129()
         {
             var test = new SimpleUnaryOpTest__ExtractInt32129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 1e6f97b..48276ba 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt641()
         {
             var test = new SimpleUnaryOpTest__ExtractInt641();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 948c09a..ad06c85 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractInt64129()
         {
             var test = new SimpleUnaryOpTest__ExtractInt64129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index d82cd42..49a44cb 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractSingle1()
         {
             var test = new SimpleUnaryOpTest__ExtractSingle1();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Single, Single>(_data, new Single[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Single) != typeof(long)) && (typeof(Single) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index f9d6e7b..a325e9e 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractSingle129()
         {
             var test = new SimpleUnaryOpTest__ExtractSingle129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Single, Single>(_data, new Single[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Single) != typeof(long)) && (typeof(Single) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 0e9cf68..69f423c 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt321()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt321();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 95182b0..ca6fadd 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt32129()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt32129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index c67da3d..399ba96 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt641()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt641();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 0a8598a..c3c896d 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void ExtractUInt64129()
         {
             var test = new SimpleUnaryOpTest__ExtractUInt64129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index de94118..f12125b 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertByte1()
         {
             var test = new SimpleUnaryOpTest__InsertByte1();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 6c4f2d5..a6a020d 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertByte129()
         {
             var test = new SimpleUnaryOpTest__InsertByte129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Byte, Byte>(_data, new Byte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Byte) != typeof(long)) && (typeof(Byte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index a896266..02ba67c 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt321()
         {
             var test = new SimpleUnaryOpTest__InsertInt321();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index c257663..5e0b41e 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt32129()
         {
             var test = new SimpleUnaryOpTest__InsertInt32129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Int32) != typeof(long)) && (typeof(Int32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index c673ce6..03110fa 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt641()
         {
             var test = new SimpleUnaryOpTest__InsertInt641();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 6cd83ad..e344759 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertInt64129()
         {
             var test = new SimpleUnaryOpTest__InsertInt64129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<Int64, Int64>(_data, new Int64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(Int64) != typeof(long)) && (typeof(Int64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index f0a4dcf..2b7af44 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertSByte1()
         {
             var test = new SimpleUnaryOpTest__InsertSByte1();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<SByte, SByte>(_data, new SByte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(SByte) != typeof(long)) && (typeof(SByte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 7bad860..4c164ab 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertSByte129()
         {
             var test = new SimpleUnaryOpTest__InsertSByte129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<SByte, SByte>(_data, new SByte[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(SByte) != typeof(long)) && (typeof(SByte) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 5ee2053..19a9902 100644 (file)
@@ -14,6 +14,8 @@ using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 using System.Runtime.Intrinsics;
 using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
 
 namespace JIT.HardwareIntrinsics.X86
 {
@@ -21,10 +23,8 @@ namespace JIT.HardwareIntrinsics.X86
     {
         private static void InsertSingle0()
         {
-            var test = new SimpleUnaryOpTest__InsertSingle0();
-            
-            try
-            {
+            var test = new SimpleBinaryOpTest__InsertSingle0();
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +77,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -90,40 +85,49 @@ namespace JIT.HardwareIntrinsics.X86
         }
     }
 
-    public sealed unsafe class SimpleUnaryOpTest__InsertSingle0
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle0
     {
         private static readonly int LargestVectorSize = 16;
 
         private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
         private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
 
-        private static Single[] _data = new Single[Op1ElementCount];
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
 
-        private static Vector128<Single> _clsVar;
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
 
-        private Vector128<Single> _fld;
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
 
-        private SimpleUnaryOpTest__DataTable<Single, Single> _dataTable;
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
 
-        static SimpleUnaryOpTest__InsertSingle0()
+        static SimpleBinaryOpTest__InsertSingle0()
         {
             var random = new Random();
 
-            for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); }
-            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar), ref Unsafe.As<Single, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
         }
 
-        public SimpleUnaryOpTest__InsertSingle0()
+        public SimpleBinaryOpTest__InsertSingle0()
         {
             Succeeded = true;
 
             var random = new Random();
 
-            for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); }
-            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld), ref Unsafe.As<Single, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
 
-            for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); }
-            _dataTable = new SimpleUnaryOpTest__DataTable<Single, Single>(_data, new Single[RetElementCount], LargestVectorSize);
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
         }
 
         public bool IsSupported => Sse41.IsSupported;
@@ -133,132 +137,135 @@ namespace JIT.HardwareIntrinsics.X86
         public void RunBasicScenario_UnsafeRead()
         {
             var result = Sse41.Insert(
-                Unsafe.Read<Vector128<Single>>(_dataTable.inArrayPtr),
-                (float)2,
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
                 0
             );
 
             Unsafe.Write(_dataTable.outArrayPtr, result);
-            ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
         }
 
         public void RunBasicScenario_Load()
         {
             var result = Sse41.Insert(
-                Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)),
-                (float)2,
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
                 0
             );
 
             Unsafe.Write(_dataTable.outArrayPtr, result);
-            ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
         }
 
         public void RunBasicScenario_LoadAligned()
         {
             var result = Sse41.Insert(
-                Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)),
-                (float)2,
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
                 0
             );
 
             Unsafe.Write(_dataTable.outArrayPtr, result);
-            ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
         }
 
         public void RunReflectionScenario_UnsafeRead()
         {
-            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Single), typeof(byte) })
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
                                      .Invoke(null, new object[] {
-                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArrayPtr),
-                                        (float)2,
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
                                         (byte)0
                                      });
 
             Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
-            ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
         }
 
         public void RunReflectionScenario_Load()
         {
-            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Single), typeof(byte) })
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
                                      .Invoke(null, new object[] {
-                                        Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)),
-                                        (float)2,
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
                                         (byte)0
                                      });
 
             Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
-            ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
         }
 
         public void RunReflectionScenario_LoadAligned()
         {
-            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Single), typeof(byte) })
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
                                      .Invoke(null, new object[] {
-                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)),
-                                        (float)2,
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
                                         (byte)0
                                      });
 
             Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
-            ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
         }
 
         public void RunClsVarScenario()
         {
             var result = Sse41.Insert(
-                _clsVar,
-                (float)2,
+                _clsVar1,
+                _clsVar2,
                 0
             );
 
             Unsafe.Write(_dataTable.outArrayPtr, result);
-            ValidateResult(_clsVar, _dataTable.outArrayPtr);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
         }
 
         public void RunLclVarScenario_UnsafeRead()
         {
-            var firstOp = Unsafe.Read<Vector128<Single>>(_dataTable.inArrayPtr);
-            var result = Sse41.Insert(firstOp, (float)2, 0);
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 0);
 
             Unsafe.Write(_dataTable.outArrayPtr, result);
-            ValidateResult(firstOp, _dataTable.outArrayPtr);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
         }
 
         public void RunLclVarScenario_Load()
         {
-            var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr));
-            var result = Sse41.Insert(firstOp, (float)2, 0);
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 0);
 
             Unsafe.Write(_dataTable.outArrayPtr, result);
-            ValidateResult(firstOp, _dataTable.outArrayPtr);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
         }
 
         public void RunLclVarScenario_LoadAligned()
         {
-            var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr));
-            var result = Sse41.Insert(firstOp, (float)2, 0);
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 0);
 
             Unsafe.Write(_dataTable.outArrayPtr, result);
-            ValidateResult(firstOp, _dataTable.outArrayPtr);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
         }
 
         public void RunLclFldScenario()
         {
-            var test = new SimpleUnaryOpTest__InsertSingle0();
-            var result = Sse41.Insert(test._fld, (float)2, 0);
+            var test = new SimpleBinaryOpTest__InsertSingle0();
+            var result = Sse41.Insert(test._fld1, test._fld2, 0);
 
             Unsafe.Write(_dataTable.outArrayPtr, result);
-            ValidateResult(test._fld, _dataTable.outArrayPtr);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
         }
 
         public void RunFldScenario()
         {
-            var result = Sse41.Insert(_fld, (float)2, 0);
+            var result = Sse41.Insert(_fld1, _fld2, 0);
 
             Unsafe.Write(_dataTable.outArrayPtr, result);
-            ValidateResult(_fld, _dataTable.outArrayPtr);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
         }
 
         public void RunUnsupportedScenario()
@@ -275,45 +282,56 @@ namespace JIT.HardwareIntrinsics.X86
             }
         }
 
-        private void ValidateResult(Vector128<Single> firstOp, void* result, [CallerMemberName] string method = "")
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
         {
-            Single[] inArray = new Single[Op1ElementCount];
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
             Single[] outArray = new Single[RetElementCount];
 
-            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray[0]), firstOp);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
             Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
 
-            ValidateResult(inArray, outArray, method);
+            ValidateResult(inArray1, inArray2, outArray, method);
         }
 
-        private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "")
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
         {
-            Single[] inArray = new Single[Op1ElementCount];
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
             Single[] outArray = new Single[RetElementCount];
 
-            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray[0]), ref Unsafe.AsRef<byte>(firstOp), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
             Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
 
-            ValidateResult(inArray, outArray, method);
+            ValidateResult(inArray1, inArray2, outArray, method);
         }
 
-        private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "")
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
         {
-
-            for (var i = 0; i < RetElementCount; i++)
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[0]))
+            {
+                Succeeded = false;
+            }
+            else
             {
-                if ((i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i])))
+                for (var i = 1; i < RetElementCount; i++)
                 {
-                    Succeeded = false;
-                    break;
+                    if (BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
                 }
             }
 
             if (!Succeeded)
             {
-                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single><9>): {method} failed:");
-                Console.WriteLine($"  firstOp: ({string.Join(", ", firstOp)})");
-                Console.WriteLine($"   result: ({string.Join(", ", result)})");
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.0): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
                 Console.WriteLine();
             }
         }
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.1.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.1.cs
new file mode 100644 (file)
index 0000000..ba6b5a0
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle1()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle1();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle1
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle1()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle1()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                1
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                1
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                1
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)1
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)1
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)1
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                1
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 1);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 1);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 1);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle1();
+            var result = Sse41.Insert(test._fld1, test._fld2, 1);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 1);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(0.0f))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.1): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.128.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.128.cs
new file mode 100644 (file)
index 0000000..c736e7b
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle128()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle128();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle128
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle128()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle128()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                128
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                128
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                128
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)128
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)128
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)128
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                128
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 128);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 128);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 128);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle128();
+            var result = Sse41.Insert(test._fld1, test._fld2, 128);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 128);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[2]))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.128): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.129.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.129.cs
new file mode 100644 (file)
index 0000000..07e25f3
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle129()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle129();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle129
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle129()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle129()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                129
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                129
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                129
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)129
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)129
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)129
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                129
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 129);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 129);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 129);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle129();
+            var result = Sse41.Insert(test._fld1, test._fld2, 129);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 129);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(0.0f))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.129): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.16.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.16.cs
new file mode 100644 (file)
index 0000000..07d80ab
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle16()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle16();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle16
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle16()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle16()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                16
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                16
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                16
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)16
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)16
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)16
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                16
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 16);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 16);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 16);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle16();
+            var result = Sse41.Insert(test._fld1, test._fld2, 16);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 16);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(left[0]))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (i == 1 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(right[0]) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.16): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.192.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.192.cs
new file mode 100644 (file)
index 0000000..c5f7eb9
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle192()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle192();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle192
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle192()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle192()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                192
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                192
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                192
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)192
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)192
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)192
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                192
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 192);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 192);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 192);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle192();
+            var result = Sse41.Insert(test._fld1, test._fld2, 192);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 192);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[3]))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.192): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.2.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.2.cs
new file mode 100644 (file)
index 0000000..da4ff5f
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle2()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle2();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle2
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle2()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle2()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                2
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                2
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                2
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)2
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)2
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)2
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                2
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 2);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 2);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 2);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle2();
+            var result = Sse41.Insert(test._fld1, test._fld2, 2);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 2);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[0]))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (i == 1 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.2): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.32.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.32.cs
new file mode 100644 (file)
index 0000000..3aaf3ea
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle32()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle32();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle32
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle32()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle32()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                32
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                32
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                32
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)32
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)32
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)32
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                32
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 32);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 32);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 32);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle32();
+            var result = Sse41.Insert(test._fld1, test._fld2, 32);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 32);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(left[0]))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(right[0]) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.32): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.4.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.4.cs
new file mode 100644 (file)
index 0000000..c961127
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle4()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle4();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle4
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle4()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle4()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                4
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                4
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                4
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)4
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)4
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)4
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                4
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 4);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 4);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 4);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle4();
+            var result = Sse41.Insert(test._fld1, test._fld2, 4);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 4);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[0]))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.4): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.48.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.48.cs
new file mode 100644 (file)
index 0000000..9651430
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle48()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle48();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle48
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle48()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle48()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                48
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                48
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                48
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)48
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)48
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)48
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                48
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 48);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 48);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 48);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle48();
+            var result = Sse41.Insert(test._fld1, test._fld2, 48);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 48);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(left[0]))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (i == 3 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(right[0]) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.48): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.64.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.64.cs
new file mode 100644 (file)
index 0000000..d47c8b0
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle64()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle64();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle64
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle64()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle64()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                64
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                64
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                64
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)64
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)64
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)64
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                64
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 64);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 64);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 64);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle64();
+            var result = Sse41.Insert(test._fld1, test._fld2, 64);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 64);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[1]))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.64): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.8.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.8.cs
new file mode 100644 (file)
index 0000000..ae2f080
--- /dev/null
@@ -0,0 +1,339 @@
+// 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\X86\Shared. In order to make    *
+ * changes, please update the corresponding template and run according to the *
+ * directions listed in the file.                                             *
+ ******************************************************************************/
+
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.X86;
+using static System.Runtime.Intrinsics.X86.Sse;
+using static System.Runtime.Intrinsics.X86.Sse2;
+
+namespace JIT.HardwareIntrinsics.X86
+{
+    public static partial class Program
+    {
+        private static void InsertSingle8()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle8();
+
+            if (test.IsSupported)
+            {
+                // Validates basic functionality works, using Unsafe.Read
+                test.RunBasicScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates basic functionality works, using Load
+                    test.RunBasicScenario_Load();
+
+                    // Validates basic functionality works, using LoadAligned
+                    test.RunBasicScenario_LoadAligned();
+                }
+
+                // Validates calling via reflection works, using Unsafe.Read
+                test.RunReflectionScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates calling via reflection works, using Load
+                    test.RunReflectionScenario_Load();
+
+                    // Validates calling via reflection works, using LoadAligned
+                    test.RunReflectionScenario_LoadAligned();
+                }
+
+                // Validates passing a static member works
+                test.RunClsVarScenario();
+
+                // Validates passing a local works, using Unsafe.Read
+                test.RunLclVarScenario_UnsafeRead();
+
+                if (Sse.IsSupported)
+                {
+                    // Validates passing a local works, using Load
+                    test.RunLclVarScenario_Load();
+
+                    // Validates passing a local works, using LoadAligned
+                    test.RunLclVarScenario_LoadAligned();
+                }
+
+                // Validates passing the field of a local works
+                test.RunLclFldScenario();
+
+                // Validates passing an instance member works
+                test.RunFldScenario();
+            }
+            else
+            {
+                // Validates we throw on unsupported hardware
+                test.RunUnsupportedScenario();
+            }
+
+            if (!test.Succeeded)
+            {
+                throw new Exception("One or more scenarios did not complete as expected.");
+            }
+        }
+    }
+
+    public sealed unsafe class SimpleBinaryOpTest__InsertSingle8
+    {
+        private static readonly int LargestVectorSize = 16;
+
+        private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+        private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single);
+
+        private static Single[] _data1 = new Single[Op1ElementCount];
+        private static Single[] _data2 = new Single[Op2ElementCount];
+
+        private static Vector128<Single> _clsVar1;
+        private static Vector128<Single> _clsVar2;
+
+        private Vector128<Single> _fld1;
+        private Vector128<Single> _fld2;
+
+        private SimpleBinaryOpTest__DataTable<Single, Single, Single> _dataTable;
+
+        static SimpleBinaryOpTest__InsertSingle8()
+        {
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+        }
+
+        public SimpleBinaryOpTest__InsertSingle8()
+        {
+            Succeeded = true;
+
+            var random = new Random();
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); }
+            for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); }
+            _dataTable = new SimpleBinaryOpTest__DataTable<Single, Single, Single>(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
+        }
+
+        public bool IsSupported => Sse41.IsSupported;
+
+        public bool Succeeded { get; set; }
+
+        public void RunBasicScenario_UnsafeRead()
+        {
+            var result = Sse41.Insert(
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                8
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_Load()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                8
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunBasicScenario_LoadAligned()
+        {
+            var result = Sse41.Insert(
+                Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                8
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_UnsafeRead()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr),
+                                        Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr),
+                                        (byte)8
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_Load()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)8
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunReflectionScenario_LoadAligned()
+        {
+            var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>), typeof(byte) })
+                                     .Invoke(null, new object[] {
+                                        Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)),
+                                        LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)),
+                                        (byte)8
+                                     });
+
+            Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result));
+            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
+        }
+
+        public void RunClsVarScenario()
+        {
+            var result = Sse41.Insert(
+                _clsVar1,
+                _clsVar2,
+                8
+            );
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_UnsafeRead()
+        {
+            var left = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr);
+            var right = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr);
+            var result = Sse41.Insert(left, right, 8);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_Load()
+        {
+            var left = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 8);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclVarScenario_LoadAligned()
+        {
+            var left = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr));
+            var right = LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr));
+            var result = Sse41.Insert(left, right, 8);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(left, right, _dataTable.outArrayPtr);
+        }
+
+        public void RunLclFldScenario()
+        {
+            var test = new SimpleBinaryOpTest__InsertSingle8();
+            var result = Sse41.Insert(test._fld1, test._fld2, 8);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunFldScenario()
+        {
+            var result = Sse41.Insert(_fld1, _fld2, 8);
+
+            Unsafe.Write(_dataTable.outArrayPtr, result);
+            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
+        }
+
+        public void RunUnsupportedScenario()
+        {
+            Succeeded = false;
+
+            try
+            {
+                RunBasicScenario_UnsafeRead();
+            }
+            catch (PlatformNotSupportedException)
+            {
+                Succeeded = true;
+            }
+        }
+
+        private void ValidateResult(Vector128<Single> left, Vector128<Single> right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), left);
+            Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), right);
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "")
+        {
+            Single[] inArray1 = new Single[Op1ElementCount];
+            Single[] inArray2 = new Single[Op2ElementCount];
+            Single[] outArray = new Single[RetElementCount];
+
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<Single>>());
+            Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>());
+
+            ValidateResult(inArray1, inArray2, outArray, method);
+        }
+
+        private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
+        {
+            if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(right[0]))
+            {
+                Succeeded = false;
+            }
+            else
+            {
+                for (var i = 1; i < RetElementCount; i++)
+                {
+                    if (i == 3 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i]))
+                    {
+                        Succeeded = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!Succeeded)
+            {
+                Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}<Single>(Vector128<Single>, Vector128<Single>.8): {method} failed:");
+                Console.WriteLine($"    left: ({string.Join(", ", left)})");
+                Console.WriteLine($"   right: ({string.Join(", ", right)})");
+                Console.WriteLine($"  result: ({string.Join(", ", result)})");
+                Console.WriteLine();
+            }
+        }
+    }
+}
index ab82f5f..efe68f6 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt321()
         {
             var test = new SimpleUnaryOpTest__InsertUInt321();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 27177f6..32ef922 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt32129()
         {
             var test = new SimpleUnaryOpTest__InsertUInt32129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt32, UInt32>(_data, new UInt32[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt32) != typeof(long)) && (typeof(UInt32) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index d4d9f99..a735dd5 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt641()
         {
             var test = new SimpleUnaryOpTest__InsertUInt641();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 62ce511..d8b339d 100644 (file)
@@ -22,9 +22,7 @@ namespace JIT.HardwareIntrinsics.X86
         private static void InsertUInt64129()
         {
             var test = new SimpleUnaryOpTest__InsertUInt64129();
-            
-            try
-            {
+
             if (test.IsSupported)
             {
                 // Validates basic functionality works, using Unsafe.Read
@@ -77,11 +75,6 @@ namespace JIT.HardwareIntrinsics.X86
                 // Validates we throw on unsupported hardware
                 test.RunUnsupportedScenario();
             }
-            }
-            catch (PlatformNotSupportedException)
-            {
-                test.Succeeded = true;
-            }
 
             if (!test.Succeeded)
             {
@@ -126,7 +119,7 @@ namespace JIT.HardwareIntrinsics.X86
             _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize);
         }
 
-        public bool IsSupported => Sse41.IsSupported;
+        public bool IsSupported => Sse41.IsSupported && (Environment.Is64BitProcess || ((typeof(UInt64) != typeof(long)) && (typeof(UInt64) != typeof(ulong))));
 
         public bool Succeeded { get; set; }
 
index 92fd2ac..542e936 100644 (file)
@@ -38,18 +38,30 @@ namespace JIT.HardwareIntrinsics.X86
                 ["Floor.Single"] = FloorSingle,
                 ["FloorScalar.Double"] = FloorScalarDouble,
                 ["FloorScalar.Single"] = FloorScalarSingle,
+                ["Insert.Single.0"] = InsertSingle0,
                 ["Insert.Byte.1"] = InsertByte1,
                 ["Insert.SByte.1"] = InsertSByte1,
                 ["Insert.Int32.1"] = InsertInt321,
                 ["Insert.UInt32.1"] = InsertUInt321,
                 ["Insert.Int64.1"] = InsertInt641,
                 ["Insert.UInt64.1"] = InsertUInt641,
+                ["Insert.Single.1"] = InsertSingle1,
+                ["Insert.Single.2"] = InsertSingle2,
+                ["Insert.Single.4"] = InsertSingle4,
+                ["Insert.Single.8"] = InsertSingle8,
+                ["Insert.Single.16"] = InsertSingle16,
+                ["Insert.Single.32"] = InsertSingle32,
+                ["Insert.Single.48"] = InsertSingle48,
+                ["Insert.Single.64"] = InsertSingle64,
+                ["Insert.Single.128"] = InsertSingle128,
                 ["Insert.Byte.129"] = InsertByte129,
                 ["Insert.SByte.129"] = InsertSByte129,
                 ["Insert.Int32.129"] = InsertInt32129,
                 ["Insert.UInt32.129"] = InsertUInt32129,
                 ["Insert.Int64.129"] = InsertInt64129,
                 ["Insert.UInt64.129"] = InsertUInt64129,
+                ["Insert.Single.129"] = InsertSingle129,
+                ["Insert.Single.192"] = InsertSingle192,
                 ["Max.Int32"] = MaxInt32,
                 ["Max.SByte"] = MaxSByte,
                 ["Max.UInt16"] = MaxUInt16,
index b6d3523..69dde3a 100644 (file)
     <Compile Include="Extract.Int64.129.cs" />
     <Compile Include="Extract.UInt64.129.cs" />
     <Compile Include="Extract.Single.129.cs" />
+    <Compile Include="Insert.Single.0.cs" />
     <Compile Include="Insert.Byte.1.cs" />
     <Compile Include="Insert.SByte.1.cs" />
     <Compile Include="Insert.Int32.1.cs" />
     <Compile Include="Insert.UInt32.1.cs" />
     <Compile Include="Insert.Int64.1.cs" />
     <Compile Include="Insert.UInt64.1.cs" />
+    <Compile Include="Insert.Single.1.cs" />   
+    <Compile Include="Insert.Single.2.cs" />   
+    <Compile Include="Insert.Single.4.cs" />   
+    <Compile Include="Insert.Single.8.cs" />   
+    <Compile Include="Insert.Single.16.cs" />  
+    <Compile Include="Insert.Single.32.cs" />  
+    <Compile Include="Insert.Single.48.cs" />  
+    <Compile Include="Insert.Single.64.cs" />  
+    <Compile Include="Insert.Single.128.cs" />
     <Compile Include="Insert.Byte.129.cs" />
     <Compile Include="Insert.SByte.129.cs" />
     <Compile Include="Insert.Int32.129.cs" />
     <Compile Include="Insert.UInt32.129.cs" />
     <Compile Include="Insert.Int64.129.cs" />
     <Compile Include="Insert.UInt64.129.cs" />
+    <Compile Include="Insert.Single.129.cs" /> 
+    <Compile Include="Insert.Single.192.cs" />
     <Compile Include="Program.Sse41.cs" />
     <Compile Include="..\Shared\BooleanUnOpTest_DataTable.cs" />
     <Compile Include="..\Shared\BooleanBinOpTest_DataTable.cs" />
index 424f767..a295796 100644 (file)
     <Compile Include="Extract.Int64.129.cs" />
     <Compile Include="Extract.UInt64.129.cs" />
     <Compile Include="Extract.Single.129.cs" />
+    <Compile Include="Insert.Single.0.cs" />
     <Compile Include="Insert.Byte.1.cs" />
     <Compile Include="Insert.SByte.1.cs" />
     <Compile Include="Insert.Int32.1.cs" />
     <Compile Include="Insert.UInt32.1.cs" />
     <Compile Include="Insert.Int64.1.cs" />
     <Compile Include="Insert.UInt64.1.cs" />
+    <Compile Include="Insert.Single.1.cs" />   
+    <Compile Include="Insert.Single.2.cs" />   
+    <Compile Include="Insert.Single.4.cs" />   
+    <Compile Include="Insert.Single.8.cs" />   
+    <Compile Include="Insert.Single.16.cs" />  
+    <Compile Include="Insert.Single.32.cs" />  
+    <Compile Include="Insert.Single.48.cs" />  
+    <Compile Include="Insert.Single.64.cs" />  
+    <Compile Include="Insert.Single.128.cs" />
     <Compile Include="Insert.Byte.129.cs" />
     <Compile Include="Insert.SByte.129.cs" />
     <Compile Include="Insert.Int32.129.cs" />
     <Compile Include="Insert.UInt32.129.cs" />
     <Compile Include="Insert.Int64.129.cs" />
     <Compile Include="Insert.UInt64.129.cs" />
+    <Compile Include="Insert.Single.129.cs" /> 
+    <Compile Include="Insert.Single.192.cs" />
     <Compile Include="Program.Sse41.cs" />
     <Compile Include="..\Shared\BooleanUnOpTest_DataTable.cs" />
     <Compile Include="..\Shared\BooleanBinOpTest_DataTable.cs" />
diff --git a/tests/src/tracing/common/RuntimeEventSource.cs b/tests/src/tracing/common/RuntimeEventSource.cs
new file mode 100644 (file)
index 0000000..8518187
--- /dev/null
@@ -0,0 +1,52 @@
+using System;
+using System.Diagnostics.Tracing;
+using System.Reflection;
+
+namespace Tracing.Tests.Common
+{
+    public static class RuntimeEventSource
+    {
+        private static FieldInfo m_staticLogField;
+
+        public static EventSource Log
+        {
+            get
+            {
+                return (EventSource) m_staticLogField.GetValue(null);
+            }
+        }
+
+        static RuntimeEventSource()
+        {
+            if(!Initialize())
+            {
+                throw new InvalidOperationException("Reflection failed.");
+            }
+        }
+
+        private static bool Initialize()
+        {
+           Assembly SPC = typeof(System.Diagnostics.Tracing.EventSource).Assembly;
+           if(SPC == null)
+           {
+               Console.WriteLine("System.Private.CoreLib assembly == null");
+               return false;
+           }
+           Type runtimeEventSourceType = SPC.GetType("System.Diagnostics.Tracing.RuntimeEventSource");
+           if(runtimeEventSourceType == null)
+           {
+               Console.WriteLine("System.Diagnostics.Tracing.RuntimeEventSource type == null");
+               return false;
+           }
+           m_staticLogField = runtimeEventSourceType.GetField("Log", BindingFlags.NonPublic | BindingFlags.Static);
+           if(m_staticLogField == null)
+           {
+               Console.WriteLine("RuntimeEventSource.Log field == null");
+               return false;
+           }
+
+           return true;
+        }
+
+    }
+}
index 32a2108..3fb7cc1 100644 (file)
@@ -28,6 +28,7 @@
     <Compile Include="Assert.cs" />
     <Compile Include="EtlFile.cs" />
     <Compile Include="NetPerfFile.cs" />
+    <Compile Include="RuntimeEventSource.cs" />
     <Compile Include="TraceControl.cs" />
     <Compile Include="TraceConfiguration.cs" />
   </ItemGroup>
diff --git a/tests/src/tracing/runtimeeventsource/RuntimeEventSourceTest.cs b/tests/src/tracing/runtimeeventsource/RuntimeEventSourceTest.cs
new file mode 100644 (file)
index 0000000..94d3585
--- /dev/null
@@ -0,0 +1,91 @@
+using System;
+using System.IO;
+using System.Diagnostics.Tracing;
+using System.Runtime.CompilerServices;
+using System.Threading;
+using Tracing.Tests.Common;
+
+namespace Tracing.Tests
+{
+    public sealed class RuntimeEventSourceTest
+    {
+        static int Main(string[] args)
+        {
+            // Get the RuntimeEventSource.
+            EventSource eventSource = RuntimeEventSource.Log;
+
+            using (SimpleEventListener noEventsListener = new SimpleEventListener("NoEvents"))
+            {
+                // Enable the provider, but not any keywords, so we should get no events as long as no rundown occurs.
+                noEventsListener.EnableEvents(eventSource, EventLevel.Critical, (EventKeywords)(0));
+
+                // Create an EventListener.
+                using (SimpleEventListener listener = new SimpleEventListener("Simple"))
+                {
+                    // Trigger the allocator task.
+                    System.Threading.Tasks.Task.Run(new Action(Allocator));
+
+                    // Enable events.
+                    listener.EnableEvents(eventSource, EventLevel.Verbose, (EventKeywords)(0x4c14fccbd));
+
+                    // Wait for events.
+                    Thread.Sleep(1000);
+
+                    // Generate some GC events.
+                    GC.Collect(2, GCCollectionMode.Forced);
+
+                    // Wait for more events.
+                    Thread.Sleep(1000);
+
+                    // Ensure that we've seen some events.
+                    Assert.True("listener.EventCount > 0", listener.EventCount > 0);
+                }
+
+                // Generate some more GC events.
+                GC.Collect(2, GCCollectionMode.Forced);
+
+                // Ensure that we've seen no events.
+                Assert.True("noEventsListener.EventCount == 0", noEventsListener.EventCount == 0);
+            }
+
+            return 100;
+        }
+
+        private static void Allocator()
+        {
+            while (true)
+            {
+                for(int i=0; i<1000; i++)
+                    GC.KeepAlive(new object());
+
+                Thread.Sleep(10);
+            }
+        }
+    }
+
+    internal sealed class SimpleEventListener : EventListener
+    {
+        private string m_name;
+
+        public SimpleEventListener(string name)
+        {
+            m_name = name;
+        }
+
+        public int EventCount { get; private set; } = 0;
+
+        protected override void OnEventWritten(EventWrittenEventArgs eventData)
+        {
+            Console.WriteLine($"[{m_name}] ID = {eventData.EventId} Name = {eventData.EventName}");
+            for (int i = 0; i < eventData.Payload.Count; i++)
+            {
+                string payloadString = eventData.Payload[i] != null ? eventData.Payload[i].ToString() : string.Empty;
+                Console.WriteLine($"\tName = \"{eventData.PayloadNames[i]}\" Value = \"{payloadString}\"");
+            }
+            Console.WriteLine("\n");
+
+
+            EventCount++;
+        }
+    }
+}
diff --git a/tests/src/tracing/runtimeeventsource/runtimeeventsource.csproj b/tests/src/tracing/runtimeeventsource/runtimeeventsource.csproj
new file mode 100644 (file)
index 0000000..e8ab52b
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{8E3244CB-407F-4142-BAAB-E7A55901A5FA}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <CLRTestKind>BuildAndRun</CLRTestKind>
+    <DefineConstants>$(DefineConstants);STATIC</DefineConstants>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <CLRTestPriority>0</CLRTestPriority>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="RuntimeEventSourceTest.cs" />
+    <ProjectReference Include="../common/common.csproj" />
+  </ItemGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+</Project>