-2.2.0-preview1-02929-01
+2.2.0-preview1-03002-01
-3.0.0-preview1-26630-01
+3.0.0-preview1-26703-04
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
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
<!-- 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>
<!-- 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 -->
// 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
// 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))
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/**")
--- /dev/null
+<?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>
--- /dev/null
+<?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>
--- /dev/null
+<?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>
<?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>
--- /dev/null
+<?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>
--- /dev/null
+<?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>
--- /dev/null
+<?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>
<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
<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>
<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>
<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" />
}
// 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;
}
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'.
}
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>
}
}
}
+
+#if FEATURE_PERFTRACING
+ // Remove the listener from the EventPipe dispatcher.
+ EventPipeEventDispatcher.Instance.RemoveEventListener(listenerToRemove);
+#endif // FEATURE_PERFTRACING
}
/// <summary>
/// </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);
}
/// </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);
}
/// </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);
}
/// </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);
}
/// </summary>
public static long Extract(Vector256<long> value, byte index)
{
- if (IntPtr.Size != 8)
+ if (!IsSupported || (IntPtr.Size != 8))
{
throw new PlatformNotSupportedException();
}
/// </summary>
public static ulong Extract(Vector256<ulong> value, byte index)
{
- if (IntPtr.Size != 8)
+ if (!IsSupported || (IntPtr.Size != 8))
{
throw new PlatformNotSupportedException();
}
/// </summary>
public static Vector256<long> Insert(Vector256<long> value, long data, byte index)
{
+ if (IntPtr.Size != 8)
+ {
+ throw new PlatformNotSupportedException();
+ }
+
unsafe
{
index &= 0x3;
/// </summary>
public static Vector256<ulong> Insert(Vector256<ulong> value, ulong data, byte index)
{
+ if (IntPtr.Size != 8)
+ {
+ throw new PlatformNotSupportedException();
+ }
+
unsafe
{
index &= 0x3;
--- /dev/null
+// 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;
+ }
+ }
+}
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 _)
using System.Reflection;
using System.Globalization;
+using System.Runtime.Remoting;
+using System.Threading;
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);
--- /dev/null
+// 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
+}
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)]
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)]
[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
--- /dev/null
+// 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
+}
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);
}
}
--- /dev/null
+// 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
+}
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))
{
}
}
+ internal void SetToken(MethodToken token)
+ {
+ m_tkMethod = token;
+ }
+
internal byte[] GetBody()
{
// Returns the il bytes of this method.
#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);
[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
#endregion
#region Private Members
-
private FieldBuilder DefineDataHelper(string name, byte[] data, int size, FieldAttributes attributes)
{
string strValueClassName;
{
return m_hasBeenCreated;
}
-
#endregion
#region FCalls
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
#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;
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>();
{
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
}
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);
}
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);
{
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;
}
}
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);
{
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)
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);
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);
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);
}
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);
int* loaded,
int* jitted,
int* failed,
+ int* excluded,
int* diffs,
bool* usageError)
{
}
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
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;
}
// 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
int errorCount = 0;
int missingCount = 0;
int index = 0;
+ int excludedCount = 0;
st1.Start();
NearDiffer nearDiffer(o.targetArchitecture, o.useCoreDisTools);
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)
{
// 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();
// 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('\\'));
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)
{
}
}
- 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;
+ }
//-------------------------------------------------------------
}
};
-ArenaAllocator::SinglePagePool ArenaAllocator::s_pagePool;
+ArenaAllocator::SinglePagePool ArenaAllocator::s_pagePool = {};
//------------------------------------------------------------------------
// ArenaAllocator::bypassHostAllocator:
if (pageSize < size)
{
NOMEM();
- return nullptr;
}
// If the current page is now full, update a few statistics
if (newPage == nullptr)
{
NOMEM();
- return nullptr;
}
if (tryPoolNewPage)
// 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);
{
if (disAddrToMethodHandleMap == nullptr)
{
- assert(disComp->getAllocator() != nullptr);
disAddrToMethodHandleMap = new (disComp->getAllocator()) AddrToMethodHandleMap(disComp->getAllocator());
}
return disAddrToMethodHandleMap;
{
if (disHelperAddrToMethodHandleMap == nullptr)
{
- assert(disComp->getAllocator() != nullptr);
disHelperAddrToMethodHandleMap = new (disComp->getAllocator()) AddrToMethodHandleMap(disComp->getAllocator());
}
return disHelperAddrToMethodHandleMap;
{
if (disRelocationMap == nullptr)
{
- assert(disComp->getAllocator() != nullptr);
disRelocationMap = new (disComp->getAllocator()) AddrToAddrMap(disComp->getAllocator());
}
return disRelocationMap;
{
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.
}
case NI_SSE_ConvertToSingle:
- case NI_SSE_StaticCast:
{
assert(op2 == nullptr);
if (op1Reg != targetReg)
}
case NI_AVX_GetLowerHalf:
- case NI_AVX_StaticCast:
{
assert(op2 == nullptr);
regNumber op1Reg = op1->gtRegNum;
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)
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)
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);
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:
{
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())
{
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);
{
// 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;
}
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
//
{
printf(" (constant)");
}
- if (isMultiReg)
- {
- printf(" (multireg)");
- }
printf(" RefPositions {");
for (RefPosition* refPosition = this->firstRefPosition; refPosition != nullptr;
regMaskTP allSIMDRegs();
regMaskTP internalFloatRegCandidates();
- bool isMultiRegRelated(RefPosition* refPosition, LsraLocation location);
bool registerIsFree(regNumber regNum, RegisterType regType);
bool registerIsAvailable(RegRecord* physRegRecord,
LsraLocation currentLoc,
, isSpecialPutArg(false)
, preferCalleeSave(false)
, isConstant(false)
- , isMultiReg(false)
, physReg(REG_COUNT)
#ifdef DEBUG
, intervalIndex(0)
// 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;
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
{
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)
{
}
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);
// 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;
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.
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
#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]
"win:UInt32" : "UInt32",
"win:UInt64" : "UInt64",
"win:Int32" : "Int32",
- "win:Pointer" : "UIntPtr",
+ "win:Pointer" : "IntPtr",
"win:UnicodeString" : "string",
"win:Binary" : "byte[]",
"win:Double" : "double",
# 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
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):
"""
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)
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" />
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()
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
// Create a new session.
EventPipeSession *pSession = new EventPipeSession(
+ EventPipeSessionType::File,
1024 /* 1 GB circular buffer */,
NULL, /* pProviders */
0 /* numProviders */);
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);
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)
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;
}
}
+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
#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,
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)
{
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
class CrawlFrame;
class EventPipeConfiguration;
class EventPipeEvent;
+class EventPipeEventInstance;
class EventPipeFile;
class EventPipeJsonFile;
class EventPipeBuffer;
// 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);
// 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
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(
void *pMetadata,
UINT32 metadataLength);
+ static INT_PTR QCALLTYPE GetProvider(
+ __in_z LPCWSTR providerName);
+
static void QCALLTYPE DeleteProvider(
INT_PTR provHandle);
EventData *pEventData,
UINT32 eventDataCount,
LPCGUID pActivityId, LPCGUID pRelatedActivityId);
+
+ static bool QCALLTYPE GetNextEvent(
+ EventPipeEventInstanceData *pInstance);
};
#endif // FEATURE_PERFTRACING
m_numBuffersStolen = 0;
m_numBuffersLeaked = 0;
m_numEventsStored = 0;
+ m_numEventsDropped = 0;
m_numEventsWritten = 0;
#endif // _DEBUG
}
}
}
-EventPipeBuffer* EventPipeBufferManager::AllocateBufferForThread(Thread *pThread, unsigned int requestSize)
+EventPipeBuffer* EventPipeBufferManager::AllocateBufferForThread(EventPipeSession &session, Thread *pThread, unsigned int requestSize)
{
CONTRACTL
{
}
}
+ // 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();
// 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
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
// 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.
{
InterlockedIncrement(&m_numEventsStored);
}
+ else
+ {
+ InterlockedIncrement(&m_numEventsDropped);
+ }
#endif // _DEBUG
return !allocNewBuffer;
}
}
}
+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
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;
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);
// 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
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
{
}
CONTRACTL_END;
- return new EventPipeSession(circularBufferSizeInMB, pProviders, numProviders);
+ return new EventPipeSession(sessionType, circularBufferSizeInMB, pProviders, numProviders);
}
void EventPipeConfiguration::DeleteSession(EventPipeSession *pSession)
class EventPipeProvider;
struct EventPipeProviderConfiguration;
class EventPipeSession;
+enum class EventPipeSessionType;
class EventPipeSessionProvider;
enum class EventPipeEventLevel
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);
#ifdef FEATURE_PERFTRACING
EventPipeSession::EventPipeSession(
+ EventPipeSessionType sessionType,
unsigned int circularBufferSizeInMB,
EventPipeProviderConfiguration *pProviders,
unsigned int numProviders)
}
CONTRACTL_END;
+ m_sessionType = sessionType;
m_circularBufferSizeInBytes = circularBufferSizeInMB * 1024 * 1024; // 1MB;
m_rundownEnabled = false;
m_pProviderList = new EventPipeSessionProviderList(
class EventPipeSessionProviderList;
class EventPipeSessionProvider;
+enum class EventPipeSessionType
+{
+ File,
+ Streaming
+};
+
class EventPipeSession
{
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);
// 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
{
// 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"
- }
- ]
- }
}
]
<!-- 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>
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%
<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>
<!-- 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 -->
<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>
<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>
private static void ExtractByte1()
{
var test = new SimpleUnaryOpTest__ExtractByte1();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractByte20()
{
var test = new SimpleUnaryOpTest__ExtractByte20();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractByte52()
{
var test = new SimpleUnaryOpTest__ExtractByte52();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt321()
{
var test = new SimpleUnaryOpTest__ExtractInt321();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt3222()
{
var test = new SimpleUnaryOpTest__ExtractInt3222();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt326()
{
var test = new SimpleUnaryOpTest__ExtractInt326();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt641()
{
var test = new SimpleUnaryOpTest__ExtractInt641();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt6419()
{
var test = new SimpleUnaryOpTest__ExtractInt6419();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt643()
{
var test = new SimpleUnaryOpTest__ExtractInt643();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt161()
{
var test = new SimpleUnaryOpTest__ExtractUInt161();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt1611()
{
var test = new SimpleUnaryOpTest__ExtractUInt1611();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt1627()
{
var test = new SimpleUnaryOpTest__ExtractUInt1627();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt321()
{
var test = new SimpleUnaryOpTest__ExtractUInt321();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt3222()
{
var test = new SimpleUnaryOpTest__ExtractUInt3222();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt326()
{
var test = new SimpleUnaryOpTest__ExtractUInt326();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt641()
{
var test = new SimpleUnaryOpTest__ExtractUInt641();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt6419()
{
var test = new SimpleUnaryOpTest__ExtractUInt6419();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt643()
{
var test = new SimpleUnaryOpTest__ExtractUInt643();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertByte1()
{
var test = new SimpleUnaryOpTest__InsertByte1();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertByte20()
{
var test = new SimpleUnaryOpTest__InsertByte20();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertByte52()
{
var test = new SimpleUnaryOpTest__InsertByte52();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt161()
{
var test = new SimpleUnaryOpTest__InsertInt161();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt1611()
{
var test = new SimpleUnaryOpTest__InsertInt1611();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt1627()
{
var test = new SimpleUnaryOpTest__InsertInt1627();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt321()
{
var test = new SimpleUnaryOpTest__InsertInt321();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt3222()
{
var test = new SimpleUnaryOpTest__InsertInt3222();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt326()
{
var test = new SimpleUnaryOpTest__InsertInt326();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt641()
{
var test = new SimpleUnaryOpTest__InsertInt641();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt6419()
{
var test = new SimpleUnaryOpTest__InsertInt6419();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt643()
{
var test = new SimpleUnaryOpTest__InsertInt643();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertSByte1()
{
var test = new SimpleUnaryOpTest__InsertSByte1();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertSByte20()
{
var test = new SimpleUnaryOpTest__InsertSByte20();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertSByte52()
{
var test = new SimpleUnaryOpTest__InsertSByte52();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt161()
{
var test = new SimpleUnaryOpTest__InsertUInt161();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt1611()
{
var test = new SimpleUnaryOpTest__InsertUInt1611();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt1627()
{
var test = new SimpleUnaryOpTest__InsertUInt1627();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt321()
{
var test = new SimpleUnaryOpTest__InsertUInt321();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt3222()
{
var test = new SimpleUnaryOpTest__InsertUInt3222();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt326()
{
var test = new SimpleUnaryOpTest__InsertUInt326();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt641()
{
var test = new SimpleUnaryOpTest__InsertUInt641();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt6419()
{
var test = new SimpleUnaryOpTest__InsertUInt6419();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt643()
{
var test = new SimpleUnaryOpTest__InsertUInt643();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
{
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))
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))
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))
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))
--- /dev/null
+<?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>
--- /dev/null
+<?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>
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+<?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>
--- /dev/null
+<?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>
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
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
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
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
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
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
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
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
private static void {Method}{RetBaseType}{Imm}()
{
var test = new SimpleUnaryOpTest__{Method}{RetBaseType}{Imm}();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
("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])"}),
private static void {Method}{RetBaseType}{Imm}()
{
var test = new SimpleUnaryOpTest__{Method}{RetBaseType}{Imm}();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
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
private static void ExtractUInt161()
{
var test = new SimpleUnaryOpTest__ExtractUInt161();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt16129()
{
var test = new SimpleUnaryOpTest__ExtractUInt16129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt161()
{
var test = new SimpleUnaryOpTest__InsertInt161();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt16129()
{
var test = new SimpleUnaryOpTest__InsertInt16129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt161()
{
var test = new SimpleUnaryOpTest__InsertUInt161();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt16129()
{
var test = new SimpleUnaryOpTest__InsertUInt16129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractByte1()
{
var test = new SimpleUnaryOpTest__ExtractByte1();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractByte129()
{
var test = new SimpleUnaryOpTest__ExtractByte129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt321()
{
var test = new SimpleUnaryOpTest__ExtractInt321();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt32129()
{
var test = new SimpleUnaryOpTest__ExtractInt32129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt641()
{
var test = new SimpleUnaryOpTest__ExtractInt641();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractInt64129()
{
var test = new SimpleUnaryOpTest__ExtractInt64129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractSingle1()
{
var test = new SimpleUnaryOpTest__ExtractSingle1();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractSingle129()
{
var test = new SimpleUnaryOpTest__ExtractSingle129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt321()
{
var test = new SimpleUnaryOpTest__ExtractUInt321();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt32129()
{
var test = new SimpleUnaryOpTest__ExtractUInt32129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt641()
{
var test = new SimpleUnaryOpTest__ExtractUInt641();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void ExtractUInt64129()
{
var test = new SimpleUnaryOpTest__ExtractUInt64129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertByte1()
{
var test = new SimpleUnaryOpTest__InsertByte1();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertByte129()
{
var test = new SimpleUnaryOpTest__InsertByte129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt321()
{
var test = new SimpleUnaryOpTest__InsertInt321();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt32129()
{
var test = new SimpleUnaryOpTest__InsertInt32129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt641()
{
var test = new SimpleUnaryOpTest__InsertInt641();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertInt64129()
{
var test = new SimpleUnaryOpTest__InsertInt64129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertSByte1()
{
var test = new SimpleUnaryOpTest__InsertSByte1();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertSByte129()
{
var test = new SimpleUnaryOpTest__InsertSByte129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
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
{
{
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
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
}
}
- 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;
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()
}
}
- 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();
}
}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
--- /dev/null
+// 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();
+ }
+ }
+ }
+}
private static void InsertUInt321()
{
var test = new SimpleUnaryOpTest__InsertUInt321();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt32129()
{
var test = new SimpleUnaryOpTest__InsertUInt32129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt641()
{
var test = new SimpleUnaryOpTest__InsertUInt641();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
private static void InsertUInt64129()
{
var test = new SimpleUnaryOpTest__InsertUInt64129();
-
- try
- {
+
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
- }
- catch (PlatformNotSupportedException)
- {
- test.Succeeded = true;
- }
if (!test.Succeeded)
{
_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; }
["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,
<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" />
<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" />
--- /dev/null
+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;
+ }
+
+ }
+}
<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>
--- /dev/null
+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++;
+ }
+ }
+}
--- /dev/null
+<?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>